Skip to content

Instantly share code, notes, and snippets.

@tad-iizuka
Created September 22, 2016 11:58
Show Gist options
  • Save tad-iizuka/1930883019195d3c7ce7ad9907338ae3 to your computer and use it in GitHub Desktop.
Save tad-iizuka/1930883019195d3c7ce7ad9907338ae3 to your computer and use it in GitHub Desktop.
Load
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