WatchKit framework is no longer included in the iOS SDK: so what ?

I read in release notes for XCode 11:


The WatchKit framework is no longer included in the iOS SDK. If youʼre using WatchKit APIs from iOS, you need to remove this use. The WatchKit framework remains available on watchOS. If youʼre using WatchKit APIs from iOS to infer availability of features on the paired Apple Watch, include information about your use case when you submit feedback to Feedback Assistant. (49707950).


I have an app (XCode 10.3) with a watchkit extension, that imports WatchKit in the app extension:

import WatchKit

import Foundation

import WatchConnectivity


What will be the impact of the change for the app design ?





Accepted Reply

WatchKit should be included in WatchKit App / Extensions, this is correct, what they are removing (i think) is the ability to import watchkit in the ios app itself, when all you should really be using is watch connectivity

Replies

Watch Connectivity is fine, that is required for communication via the WCSession Delegate for watch app to communicate wiht the ios app if its needed. I think they mean if you import the entire watchkit framework into your ios app , you cant do that anymore. (im not sure what the use case would be on that anyways tbh). I would assume if your app builds at this point, your not breaking any rules / you should be fine and you dont need to make changes. Im guessing if you werent doing something correctly the app would not build at this point.

I will soon try directly (waiting for a stable XCode 11 and Mojave…)


Yes the app buils, on XCode 10.3. Not tested on 11.


The question was also: if WatchKit is no more included in IOS SDK, where is it ?

WatchKit should be included in WatchKit App / Extensions, this is correct, what they are removing (i think) is the ability to import watchkit in the ios app itself, when all you should really be using is watch connectivity

I will test on this basis. Thanks.


EDITED.

I tested and it works without any change to the app.

What has changed is the way schemes are organized.

Before, there was an IOS scheme and a Watch scheme, the watch scheme including both targets : iPhone and APpleWatch.


Nos, there are 2 schemes, but the watch scheme includes only the watch.


However, when compiling, it creates both (and opens the 2 simulators).