Is there any way to call container app
method from extension keyboard
?
I tried by using following NSNotificationCenter, But still its not working.
I have added NSNotificationCenter and method into my main container app.
NSNotificationCenter.defaultCenter().addObserver(
self,
selector: #selector(method),
name: "methodClicked",
object: nil)
func method(){
//doing stuff
}
and in my app extension keyboard
I'm checking if container app is currently visible then post that notification NSNotificationCenter.defaultCenter().postNotificationName("methodClicked", object: nil)
Please post answer in Objective-c or Swift
if anyone know proper way to do it. Thanks in advance.