CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Oct 2015 |
Maintained by “Steffi”.
SMTNavigationBar simply centralizes your custom navigation bar. Create navigation buttons once and viola you can access it on any of your UIViewControllers.
#import "UIViewController+SMTNavigationBar.h" UIButton * leftBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 44, 44)];
[leftBtn setTitle:@"left" forState:UIControlStateNormal];
[leftBtn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[self createButtonWithKey:@"leftBtn" button:leftBtn]; [self setLeftBarButtonItemWithKey:@"leftBtn" isDefault:YES isPop:YES]; -(void)viewWillAppear:(BOOL)animated{
[self loadDefaults];
}/* List of items
LEFT_ITEM
RIGHT_ITEM
TITLE_ITEM
TITLEVIEW_ITEM
*/
[self loadDefaultWithItem:RIGHT_ITEM];[self setLeftBarButtonItemWithKey:@"leftBtn" isDefault:YES withSelectorBlock:^(UIViewController *vc) {
//When controller is popped. VC becomes a uinavigationcontroller class.
if([vc isKindOfClass:[UINavigationController class]]){
UINavigationController * vcs = (UINavigationController *) vc;
vc = [vcs viewControllers].lastObject;
}
NSLog(@"This is the block method generated on first VC but is now being presented in %@",vc.navigationItem.title);
}]; if([vc isKindOfClass:[UINavigationController class]]){
UINavigationController * vcs = (UINavigationController *) vc;
vc = [vcs viewControllers].lastObject;
} [self runLeftSuperBlock];
[self runRightSuperBlock]; -(void)SMTNavigationBarDidTapLeftItem
-(void)SMTNavigationBarDidTapRightItem
-(void)SMTNavigationBarDidPop UIImageView * imgView =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
imgView.contentMode = UIViewContentModeScaleAspectFill;
imgView.clipsToBounds = NO;
[self createTitleViewWithKey:@"titleView" titleview:imgView]; [self setTitleViewWithKey:@"titleView" isDefault:YES];[self setTitle:@"ABC" isDefault:YES];1.2
v.1.2
v.1.0
riza027 - https://github.com/riza027/
Fork, implement, pull request.
Copyright (c) 2015 Steffi Tan
See MIT-LICENSE for further details.