Post

Replies

Boosts

Views

Activity

Navigation Bar Back Button
Hi Right now I have 2 views. 1) Main page contains Login Button (When clicked, it will go to Login Page) 2) Login page with back button on navigation bar. The main page is set to hide nav bar. This works fine with this code self.navigationController?.navigationBar.isHidden = true Now, when I click the login button on the main page, it goes to the login page. In the login page I tried to rename the back button. But it does not work. This is the code that I used:      navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil,             action: #selector(didTapBack)             )                navigationItem.backBarButtonItem?.title = "hohoho" It still shows the back button named as Back Now, when I tap the back button, it goes back to the main page. which is correct. However, at the main page it also displays the navigation bar without the back button. How can I hide the navigation bar when the user returns to the main page after clicking the back button?
2
0
8.7k
Jan ’21