Amir_P Amir_P - 1 year ago 66
Swift Question

Can't hide BackButton after performSegueWithIdentifier

In my application I have a login scene which embedded with

Navigation Bar
. after user logged in, I'm navigating to home scene which only embedded with
Tab Bar
. For navigating I'm using a Segue and this is my code:

self.performSegueWithIdentifier("loginSegue", sender: nil)

and in next scene
I'm trying to
but it doesn't work

I tried all of this codes but BackButton still showing so this is not duplicated question:

self.navigationItem.leftBarButtonItem = nil
self.navigationItem.setHidesBackButton(true, animated:true);

Answer Source

Write this in your viewDidLoad method. It should work:

self.tabBarController?.navigationItem.hidesBackButton = true
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download