Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddAccount: UIViewController {
- let DataContext= (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
- @IBAction func addAccount(_ sender: UIBarButtonItem) {
- let newAccount = Account(context: DataContext)
- newAccount.name = nameuser.text
- newAccount.username= username.text
- newAccount.password= password.text
- (UIApplication.shared.delegate as! AppDelegate).saveContext()
- }
- }
Add Comment
Please, Sign In to add comment