How to hide ‘Back’ button on iOS App Xcode Storyboard Transition from one screen to next detail ui view screen

You really want to hide this ‘Back’ button when you transition from one screen to next probably detail view screen where Xcode put this automatically for you without asking you want it or not.

 
But here is work around how to hide this ‘Back’ button programmatically using Objective C,

 

[self.navigationItem setHidesBackButton:YES animated:YES]; // Objective C Code

 
Here is how to hide ‘Back’ button using Swift Language…

 

self.navigationItem.setHidesBackButton(true, animated:true);

 
Put this code in your viewDidLoad in .m file for Objective C based iOS App,

 

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.navigationItem setHidesBackButton:YES animated:YES];
}

 
OR see below example how your viewDidLoad look for Swift based iOS App,

 

override func viewDidLoad() {
   super.viewDidLoad()
   // Do any additional setup after loading the view, typically from a nib.
        
   self.navigationItem.setHidesBackButton(true, animated:true);
}

 
Hope it helps,

 
Thanks & Regards
Mandar Apte

Mandar Apte

This website contains a design articles blog by Mandar Apte. He writes and shares his iOS development, graphic, web, & animation film design experience through articles. Mandar is Mumbai based multi-disciplinary designer with expertise in UI, UX, Logo, Symbol, and Brand Identity design. He is an alumnus of Sir J. J. Institute of Applied Art, Mumbai. He currently runs his studio in the heart of the city of Mumbai.

Leave a Reply

Your email address will not be published. Required fields are marked *