0

How do you call a method in the Watch ExtensionDelegate from an interface controller?

For the life of me I cannot get it to work?

So, ExtensionDelegate.mymethod(string:param)

??

Piginhat
  • 131
  • 9

1 Answers1

2

Here is how you get an instance of your watchkit delegate:

let myDelegate = WKExtension.sharedExtension().delegate as! ExtensionDelegate

You can call your methods on this object.

lehn0058
  • 19,977
  • 15
  • 69
  • 109
  • Thanks a million ;-) – Piginhat Jan 19 '16 at 07:46
  • Ever run into a problem on the ComplicationController side where you can't seem to get the data you set in the ExtensionDelegate via WCSession: to be pulled? Thats what I'm getting stuck on right now http://stackoverflow.com/questions/35542729/call-extensiondelegate-to-create-refresh-data-for-complication – SRMR Feb 22 '16 at 00:16
  • have not used complications yet, sorry – Piginhat Feb 25 '16 at 13:58