// In the current view controller, not the one that is one level up in the stack
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationController.navigationBar.backItem.title = @"Custom text";
}
-(void)viewWillAppear:(BOOL)animated {
// Set title
self.navigationItem.title=@"Original Title";
}
-(void)viewWillDisappear:(BOOL)animated {
// Set title
self.navigationItem.title=@"Back";
}
func setBackButtonNavBar(title: String, delay: Double){
let when = DispatchTime.now() + delay
DispatchQueue.main.asyncAfter(deadline: when, execute: { () -> Void in
if let navBar = self.navigationController?.navigationBar{
navBar.backItem?.title = title
}
})
}