cell
cell

Reputation: 119

ios custom back button (NOT in the navi bar)

i'm building my own navigation between views and i have the navi bar hidden by purpose. still, i need a button inside the view (read outside the navi bar) that would behave like "back" button. is there such method to call that could be assigned to a custom button?

i tried standard push segues, but looping back will create new instances and I just need a standard back behavior (that will destroy the current instance).

i guess it's obvious, but somehow i've been missing it. thanks.

Upvotes: 1

Views: 551

Answers (1)

JAB
JAB

Reputation: 3233

Create a button as normal in your view, then connect it to a method that pops the view from the stack. Something like this:

- (IBAction) pressedBackButton:(UIButton *)sender {
   [self.navigationController popViewControllerAnimated:YES];
}

Upvotes: 5

Related Questions