Advertisement
Guest User

PersistentContainer.swift

a guest
Dec 16th, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.72 KB | None | 0 0
  1. import CoreData
  2.  
  3. struct CoreDataServiceConsts {
  4.     static let applicationGroupIdentifier = "com.coredatainextension"
  5. }
  6.  
  7. final class PersistentContainer: NSPersistentContainer {
  8.     internal override class func defaultDirectoryURL() -> URL {
  9.         var url = super.defaultDirectoryURL()
  10.         if let newURL =
  11.             FileManager.default.containerURL(
  12.                 forSecurityApplicationGroupIdentifier: "group.com.coredatainextension.somedata") {
  13.             url = newURL
  14.         }
  15.         return url
  16.     }
  17. }
  18.  
  19. //var containerPath = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.nevercalledagain.contacts")?.path
  20. //var sqlitePath = "(containerPath)/("database.sqlite")"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement