Skip to content

Instantly share code, notes, and snippets.

@andrehsouza
Last active July 6, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrehsouza/1a4516ad68d78fdac904289120b08074 to your computer and use it in GitHub Desktop.
Save andrehsouza/1a4516ad68d78fdac904289120b08074 to your computer and use it in GitHub Desktop.
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: "CoreDataExample")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment