Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add complications to my EXISTING Xcode project?

How can I add complications to my EXISTING Xcode 7 project?

Looking at WWDC video 2015 session 209 the way shown to add complications is to create a new project and click on Include Complication. This works fine for that case but how can I add them in an existing project?

enter image description here

I can't find a complication controller in the XCode object selector (See below):

enter image description here

Why is this happening??

like image 587
mm24 Avatar asked Aug 21 '15 12:08

mm24


1 Answers

Add a new temp watch extension target and check the complication check box. Copy the complication extension properties from this new info.plist (CLKComplicationSupportedFamilies, WKExtensionDelegateClassName & CLKComplicationPrincipalClass) into your old watch extension info.plist. Once you do that you will see the complication Families listing.

I also moved the ExtensionDelegate & ComplicationController classes into the old watch extension and changed the target membership to the old watch extension from the new watch extension.

Right click inside the old watch extension asset file and add the complication image set.

Also "tom_witkin Jul 23, 2015 8:50 AM (in response to breville) The ClockKit framework is only available on watchOS 2, not iOS. Thus, complications are not supported for existing WatchKit apps where the extension is running on the iPhone."

So do the recommended build settings change when moving from wos1 to wos2 (if there is a warning during compilation), and make WATCHOS_DEPLOYMENT_TARGET = 2.0 in both the old extension & watch app build settings.

Add TARGETED_DEVICE_FAMILY = 4 for old watch extension, if not present.

like image 91
Gamma-Point Avatar answered Sep 28 '22 14:09

Gamma-Point