Created
September 22, 2016 11:58
-
-
Save tad-iizuka/1930883019195d3c7ce7ad9907338ae3 to your computer and use it in GitHub Desktop.
Load
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
func loadCoreData() { | |
let fetchRequest: NSFetchRequest<Manager> = Manager.fetchRequest() | |
do { | |
self.item = try (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext.fetch(fetchRequest) | |
} catch { | |
print(String(format: "Error %@: %d",#file, #line)) | |
} | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.tableView.tableFooterView = UIView() | |
} | |
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
self.loadCoreData() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment