How to hide navigation bar back button? How to hide navigation bar back button? objective-c objective-c

How to hide navigation bar back button?


I had the same problem and solved it using :

NSMutableArray* controllerNames = [NSMutableArray new];[controllerNames addObject:@"myInterfaceController"];[WKInterfaceController reloadRootControllersWithNames:controllerNames contexts:myArrayOfData];

When the ICs are reloaded then they don't have navigation back buttons as they are the main IC.

Note

This method actually change your Initial Controller ( Main Interface Controller with arrow in storyboard.) of your watch app, that is the reason the Interface Controller does not have back button.


Here is the Swift version for all the trailblazers out there:

WKInterfaceController.reloadRootControllersWithNames(["myInterfaceController"], contexts: [])


+ (void)reloadRootControllersWithNames:(NSArray *)names contexts:(NSArray *)contexts;

But you will lose the 'push' animation.