I am creating a taller navigation bar, height == 200, however, when i clicked below the back button, it also navigates back.
here is my code:
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
navBar = [[SRNavigationBar alloc] initWithFrame:CGRectMake(0, 0, screenWidth, 200.0)];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:NO];
[self.navigationItem setHidesBackButton:YES animated:YES];
__weak id weakSelf = self;
self.navigationController.interactivePopGestureRecognizer.delegate = weakSelf;
[self styleNavBar];
}
- (void)styleNavBar
{
UINavigationItem *newItem = [[UINavigationItem alloc]initWithTitle:[[PFUser currentUser] objectForKey:@"nickName"]];
UIBarButtonItem *menu = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"back"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
newItem.leftBarButtonItem = menu;
newItem.leftBarButtonItem.tintColor = [UIColor colorWithRed:245/255.0 green:124/255.0 blue:0/255.0 alpha:1];
[navBar setItems:@[newItem]];
[self.view addSubview:navBar];
}
- (void)back
{
[self.navigationController popViewControllerAnimated:YES];
}
Any help will be appreciated