How to add array using CoreData

The following code is just a blank coreData set. I just want to add a string array to this current code.

import UIKit
import CoreData

class ViewController: UIViewController {
@IBOutlet var txt: UITextField!



@IBAction func submit(_ sender: Any) {

            let appdeleaget = UIApplication.shared.delegate as! AppDelegate
            let context = appdeleaget.persistentContainer.viewContext
            let NewUser = NSEntityDescription.insertNewObject(forEntityName: "Users", into: context)

            do {
                try context.save()
                print(NewUser)

            }
            catch {
                //
            }

        }}

This topic was automatically closed after 166 days. New replies are no longer allowed.