ios - Call a public method of a WKInterfaceController from ExtensionDelegate class- WatchKit -
i calling the
`[[wcsession defaultsession] updateapplicationcontext:message error:error]`
method triggered in my
`-(void)session:(wcsession *)session didreceiveapplicationcontext:(nsdictionary<nsstring *,id> *)applicationcontext`
method in extensiondelegate
. here want call public method in wkinterfacecontroller
update ui. don't want reload root controllers particular controller not root controller. possible call public method extensiondelegate
. can call
-(void)session:(wcsession *)session didreceiveapplicationcontext:(nsdictionary<nsstring *,id> *)applicationcontext
from somewhere within interface controller instead of extensiondelegate
?
you can use wcsession
's
public func sendmessage(message: [string : anyobject], replyhandler: (([string : anyobject]) -> void)?, errorhandler: ((nserror) -> void)?)
this invoke wcsessiondelegate
's
public func session(session: wcsession, didreceivemessage message: [string : anyobject], replyhandler: ([string : anyobject]) -> void)
method in delegate class. can used both app , extension instantaneous message transfer. read more
Comments
Post a Comment