Is there a way to close a WatchKit
app?
In iOS Simulator there is home button (cmd + shift + h) that will trigger closing app event. I was wondering if there is something similar in WatchKit
emulator?
The problem - I have one WKInterfaceController
and I never receive "didDeactivate
" method call.
No, this functionality is not currently available in the iOS Simulator. The current implementation is not a full simulator of the watch, it is just a simulator for WatchKit implemented as an external display attached to the simulated iPhone (not as a separate device).
The closest thing at your disposal is to just turn off the external display by going to the Hardware -> External Displays menu and choosing "Disabled"
Quoting from https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html
During testing, you can lock and unlock the simulator to verify that your
activation and deactivation code is working as expected.
When you use the Hardware > Lock command to lock the simulator,
WatchKit calls the didDeactivate method of the current interface controller.
When you subsequently unlock the simulator,
WatchKit calls the willActivate method of the interface controller.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With