Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS WatchKit - How to detect when back button is pressed on Watch?

I need to do some cleanup on 2nd view controller when the back button (arrow) is pressed on the Apple Watch. Is there any sort of method for detecting/handling when a back button is pressed / view is popped?

Note - I can't use 'willDeactivate()' function as it gets me stuck in a loop for what I am trying to do.

like image 201
JimmyJammed Avatar asked Apr 09 '15 23:04

JimmyJammed


People also ask

What is double pinch on Apple Watch?

Double-pinch to move back to Air Quality. Double-clench to show the Action Menu. Pinch to move forward through the actions; double-pinch to move back. Select the Press Crown action, then clench once to return to the watch face.

What is the Action menu on Apple Watch?

The action menu is context-aware, so it changes to show relevant actions based on how you're using your Apple Watch. To use the action menu, perform the hand gesture associated with it (the default is a double clench). Then use gestures to go forward or backward in the list of items, and to tap an item.

What is WatchKit app?

The WatchKit framework provides infrastructure for creating watchOS apps, including an extension delegate that manages background tasks, extended runtime sessions, and Siri intents. The framework also performs other support tasks, such as accessing information about the user's Apple Watch.

How do I open Apple Watch?

Turn on: If your Apple Watch is off, press and hold the side button until the Apple logo appears (you might see a black screen for a short time first). The watch face appears when Apple Watch is on.


1 Answers

There is no method to detect that the back button was touched. The correct/only place would be in didDeactivate, though it sounds like that won't work for you.

like image 69
Mike Swanson Avatar answered Oct 28 '22 22:10

Mike Swanson