In my Apple Watch app, one of my interface controllers has a Cancel button at the top left corner. In my case, once a particular action is completed, I don't want the user to go back to the previous screen, so I want to disable the user interaction for that Cancel button. Even if I change the title to an empty string, user interaction still stays enabled.
Press and hold both the side button and Digital Crown for at least 10 seconds. Release both buttons when you see the Apple logo.
Apple Watch Series 4 and later provides haptic feedback for the Digital Crown, which gives people a more tactile experience as they scroll through content. By default, the system provides linear haptic detents — or taps — as people turn the Digital Crown a specific distance.
Touch and hold the top of the watch face to open Notification Center. You can do this from any screen. Wait for Notification Center to show, then swipe down. Turn the Digital Crown to scroll, or swipe up and down on the watch face.
We can't disable the back/cancel button user intaraction but can load controller without cancel button.
presentControllerWithName("NewInterfaceController", context: nil)
presentControllerWithName this will present controller with cancel button. If we use like below won't get the cancel button.
WKInterfaceController.reloadRootControllersWithNames(["NewInterfaceController"], contexts: ["NewInterfaceController"])
reloadRootControllersWithNames this will make our controller as a root controller so we won't get cancel button. This is how i resolved my issue. Hope it will help you as well.
NOTE: here [ ] is the syntax. exp: ["NewInterfaceController"]
You can't disable user interaction for back button.
But you can change a bit the way you present your views to accomplish what you want.
Start with your normal view. Check if you need to show the user the login. If you do, then present the login view Modally. At the end of login you close the modal view and you're back to normal view, without unnecessary back button.
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