Have anyone worked on migrating an iOS app with Watch OS1 to Watch OS2 or higher versions. I have used Coredata & Appgroups for sharing data between iPhone app and watch app. Now in the newer Watch OS 2(& above) Apple no longer supports Appgroups to share data across iPhone app & Apple Watch app. Could you please help me in this. I need to use Coredata to share data between the targets without having Appgroups.
2 Answers
Implement two-way communication between your Apple Watch app and the paired iPhone app with the Watch Connectivity framework.
Apple provided the sample code here for connectivity between apple watch app and iphone app using latest OS version.
Apple OverView
Most Apple Watch apps require an exchange of data with a paired iPhone app. This sample demonstrates how to use the Watch Connectivity APIs to:
- Update application contexts
- Send messages
- Transfer user info and manage the outstanding transfers
- Transfer files, view transfer progress, and manage the outstanding transfers
- Update current complications from iOS apps
- Handle Watch Connectivity background tasks

- 594
- 2
- 7
On watchOS 1, the watch app was an app extension that actually ran on the paired phone and the watch simply acted as a remote display. This is why it was possible to share data using an app group, just as you can with any other extension.
From watchOS 2.0 onwards the watch app executes on the watch itself so the watch app and the companion app no longer share a file system.
In fact, where possible, users should be able to use the watch app even when the watch isn't near the paired phone. This means that you need to adopt an asynchronous data sharing approach between the watch and phone apps
You will need to use the Watch Connectivity Framework for your app.

- 108,386
- 14
- 159
- 186
-
There is some from Apple linked in the other answer. There are probably also tutorials or example code if you search – Paulw11 Dec 27 '19 at 00:47