Search code examples
iosuinavigationcontrollerback-buttonwatchkitpopviewcontroller

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.


Solution

  • 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.