Reputation: 23
Error - [WKInterfaceController pushControllerWithName:context:]: called from queue other than main. This is not supported and may fail in the future.
In my iOS with apple watch, this error is coming when I am trying to push WKInterfaceController.
What I tried -
DispatchQueue.main.thread
Delay Timer
DispatchQueue.main.async { if message["xyz screen"] == "new screen" { popToRootController() self.pushController(withName: "new", context: self) return } }
Upvotes: 0
Views: 116
Reputation: 151
If you have in your code:
pushController(withName: "Name", context: context)
Just add in the main thread with self
inside:
DispatchQueue.main.async {
self.pushController(withName: "Name", context: self.context)
}
Upvotes: -1