Tinku
Tinku

Reputation: 247

title is not showing on navigation bar in ios but back button is showing

Actually, I am pushing to different view controller from the table view. On some view controller, there is clickable option on navigation bar, then set the title bar but on some different view controller , there is non clickable option means when click on navigation bar, navigation bar comes blue. But on some , there is no clickable option. So, I set the title programatically. How to set the title on storyboard. If anyone have idea, please share your idea

Upvotes: 0

Views: 86

Answers (1)

jay Prajapat
jay Prajapat

Reputation: 69

In story board it doesn't get automatically connected so make a UINavigationItem using the following code in your .h file

@property(weak, nonatomic) IBOutlet UINavigationItem *navBar;

in .m file synthesize the property and set the title like this

@synthesize navBar;
  -(void)viewWillAppear:(BOOL)animated {
        [self.navBar setTitle:@"Sign In"];
        [self.navigationController setNavigationBarHidden:NO animated:animated];
        }

Upvotes: 1

Related Questions