Latest 1.2.1
License MIT
Platforms ios 8.0, requires ARC

SMTNavigationBar simply centralizes your custom navigation bar. Create navigation buttons once and viola you can access it on any of your UIViewControllers.

Quick Start

Cocoapods – Add in Podfile
pod 'SMTNavigationBar'
#import "UIViewController+SMTNavigationBar.h"
Create button
 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];
Set button in the Navigation Bar
 [self setLeftBarButtonItemWithKey:@"leftBtn" isDefault:YES isPop:YES];
After this you can get the configured navigation bar by

Important : Always load defaults on viewWillAppear

    [self loadDefaults];
Load defaults individually
/* List of items
[self loadDefaultWithItem:RIGHT_ITEM];

Button Target Selectors

Using Blocks
[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);
Note: UIViewController * vc becomes a UINavigationController class if its presented after a pop. In such case use this inside the block
 if([vc isKindOfClass:[UINavigationController class]]){
            UINavigationController * vcs = (UINavigationController *) vc;
            vc = [vcs viewControllers].lastObject;
Reusing blocks
 [self runLeftSuperBlock];
 [self runRightSuperBlock];
Target Selectors
Catch the button control event in their corresponding selectors.
Create titleview
 UIImageView * imgView =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.png"]];
 imgView.contentMode = UIViewContentModeScaleAspectFill;
 imgView.clipsToBounds = NO;
 [self createTitleViewWithKey:@"titleView" titleview:imgView];
Set titleview
 [self setTitleViewWithKey:@"titleView" isDefault:YES];
Set title
[self setTitle:@"ABC" isDefault:YES];
See demo project for more detailed implementation



Change log


  • Added titleview customization
  • Added support for navigation title
  • Added loading of default items individually
  • Included new titleview and title on reset and clear.


  • Setting bar items
  • Bar items block selectors
  • Resetting values
  • Clearing navigation bar

Next Steps

  • Navigation bar configuration
  • Swift counterpart
  • Better documentation writeup


riza027 –

Lets build together!

Fork, implement, pull request.


Copyright (c) 2015 Steffi Tan
See MIT-LICENSE for further details.

Latest podspec

    "name": "SMTNavigationBar",
    "version": "1.2.1",
    "summary": "Customize iOS Navigation Bar items conveniently.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Steffi": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "v1.2.1"
    "source_files": "SMTNavigationBarDemo/SMTNavigationBar/*",
    "requires_arc": true

Pin It on Pinterest

Share This