Beast
Beast

Reputation: 129

Remove the navigation bar from the home screen.

I have the main home screen in my app, which contains the app logo, sign up and log in button. When i press log in it should show a new page which provides different logging options through twitter, facebook, google. But i should also be able to get back, just in case I haven't signed up yet. When i Embed the main ViewConroller with a navigation controller, I have an unnecessary navigation bar even in the home screen. Is there anyway to remove it?

Upvotes: 3

Views: 807

Answers (2)

Kristijan Delivuk
Kristijan Delivuk

Reputation: 1252

Function that does that:

navigationController?.setNavigationBarHidden(navigationController?.navigationBarHidden == true, animated: true) 

Upvotes: 1

Gordonium
Gordonium

Reputation: 3487

Rather than remove it entirely, my guess is that you just want to hide it?

Perhaps try something like this:

navigationController!.navigationBar.hidden = true

Upvotes: 2

Related Questions