Evgenii
Evgenii

Reputation: 37329

How to get current extension delegate on watchOS?

Is there a way to get the instance of extension delegate on watchOS? For example, can I get its instance from an interface controller or other code in the watch extension?

Upvotes: 16

Views: 4467

Answers (2)

Blank
Blank

Reputation: 4892

In Swift:

let watchDelegate = WKExtension.shared().delegate as? ExtensionDelegate

Upvotes: 25

jeeeyul
jeeeyul

Reputation: 3787

[WKExtension sharedExtension].delegate

Upvotes: 26

Related Questions