-
-
Save tad-iizuka/9a0525c0b1a1f221a06f7197f5e6ac49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext | |
let manager = Manager(context: context) | |
let textField = alert.textFields![0] as UITextField | |
if textField.text != "" { | |
manager.name = textField.text | |
} else { | |
manager.name = String(self.item.count+1) | |
} | |
manager.date = NSDate() | |
do { | |
try context.save() | |
} catch { | |
print(String(format: "Error %@: %d",#file, #line)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment