daily pastebin goal
24%
SHARE
TWEET

PersistentContainer.swift

a guest Dec 16th, 2016 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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")"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top