If you create a brand new project and add a WatchKit app, you're provided an ExtensionDelegate class that looks useful. But when I upgraded my existing WatchKit app via the Xcode 7 warning/suggestion, I didn't get this new class. How can I add it and ensure it will be used for my app?
ExtensionDelegate for existing WatchKit apps
Hi,
first add a new class to your watchkit extension target. Something like
@interface ExtensionDelegate : NSObject <WKExtensionDelegate>second, go to the WatchKit extension info.plist and add a new string entry with the key "WKExtensionDelegateClassName" and the name of your class as value.
Dirk
Thanks, I've done just that but applicationDidFinishLaunching is not called - it doesn't stop on a breakpoint in that function.
I still can't get this to work. Anyone?
I was not successful in adding an extension delegate class to my watch 1.0 project, so I gave up and created a new extension target for WatchOS 2.0, moved my interface controller code and storyboard to it, and deleted the 1.0 target.
The interface controller APIs like openParentApplication have been deprecated, so it may just be easier to slay this beast by trying the above, especially with beta Xcode.
When using Swift you must prepend $(PRODUCT_MODULE_NAME) to the class name for the value to WKExtensionDelegateClassName.