Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.34 KB | None | 0 0
  1. func saveContext() {
  2.         let context = persistentContainer.viewContext
  3.         if context.hasChanges {
  4.             do {
  5.                 try context.save()
  6.             } catch {
  7.                 let nserror = error as NSError
  8.                 fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
  9.             }
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement