Skip to content

Instantly share code, notes, and snippets.

@nikhil-thakkar
Created February 28, 2015 05:16
Show Gist options
  • Save nikhil-thakkar/ed54088784a40759c979 to your computer and use it in GitHub Desktop.
Save nikhil-thakkar/ed54088784a40759c979 to your computer and use it in GitHub Desktop.
#import <UIKit/UIKit.h>
@interface CustomNavigationController : UINavigationController<UINavigationControllerDelegate>
@end
#import "CustomNavigationController.h"
@interface CustomNavigationController()
{
BOOL shouldIgnorePushingViewControllers;
}
@end
@implementation FBNavigationController
-(instancetype)init {
self = [super init];
self.delegate=self;
return self;
}
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if (!shouldIgnorePushingViewControllers)
{
[super pushViewController:viewController animated:animated];
}
shouldIgnorePushingViewControllers = YES;
}
- (void)didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
shouldIgnorePushingViewControllers = NO;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment