title: Core data sharing between iPhone and Apple Watch apps
body: <p>I need to share data stored using Core Data between my Apple Watch app and iPhone app. I found that I need to create a framework for the same from the follwing repo <a href="https://github.com/aalittle/CoreDataWatchKit" rel="nofollow">Apple Watch and Core Data</a></p>
  
  <p>Also I've found the following code from Raywenderlich to share Core Data:</p>
  
  <pre><code>let kMyAppGroupName = "com.raywenderlich.mywatchapp.container"
  var sharedContainerURL: NSURL? = NSFileManager.defaultManager().
   containerURLForSecurityApplicationGroupIdentifier(kMyAppGroupName)
   if let sharedContainerURL = sharedContainerURL {
   let storeURL = sharedContainerURL.URLByAppendingPathComponent("MyCoreData.sqlite")
   var coordinator: NSPersistentStoreCoordinator? = 
  NSPersistentStoreCoordinator(managedObjectModel:self.managedObjectModel) coordinator?.addPersistentStoreWithType(NSSQLiteStoreType, 
  configuration: nil,
  URL: storeURL,
  options: nil,
  error: nil)
  }
  </code></pre>
  
  <p>I've already done the iPhone part of the app using Core Data but I fail to share it with Apple Watch app. Can anyone suggest a way so that I can extend my current Core Data store to the apple watch app? </p>