raginggoat
raginggoat

Reputation: 3600

Return to Previous WatchKit Interface Controller

I have an interface controller that goes to another interface controller when a button is pressed. I do it like this

- (IBAction)setLocationPressed {
    [self pushControllerWithName:@"setLocation" context:self.appContext];
}

How can I return to the first controller when a button on the second one is pressed?

Upvotes: 1

Views: 321

Answers (1)

bgilham
bgilham

Reputation: 5939

If you check out the documentation for WKinterfaceController (https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html#//apple_ref/occ/instm/WKInterfaceController/popController) you'll see two methods that are relevant to what you want to do: popController and popToRootController.

Upvotes: 3

Related Questions