awlcs
awlcs

Reputation: 13

How to assign the backbutton in the navigation bar to ouais own custom button?

I'm actually on a project and I have to hide the navigation bar. And instead, I want to use my own custom button. Could you advise please?

Is there something like pullviewcontroller that does that?

Upvotes: 0

Views: 103

Answers (2)

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31730

you could use your UIViewController life cycle function to set you navigation bar hide and shown ,

- (void) viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void) viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

Upvotes: 0

Vladimir
Vladimir

Reputation: 170859

You can call popViewControllerAnimated: on navigation controller yourself to return to previous view controller.

Upvotes: 1

Related Questions