Skip to content

Instantly share code, notes, and snippets.

@ThinhPhan
Created June 12, 2015 09:58
Show Gist options
  • Save ThinhPhan/96fc805ade4bebefd96a to your computer and use it in GitHub Desktop.
Save ThinhPhan/96fc805ade4bebefd96a to your computer and use it in GitHub Desktop.
Custom Back Button And Swipe Back. The only nice way I found to actually completely override the back button is to set the leftBarButtonItem, but then the swipe back gesture breaks. Luckily it's an easy fix when you know how
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:img
style:UIBarButtonItemStylePlain
target:self
action:@selector(onBack:)];
self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment