Issue with Back button

Hi. I have a problem, because I can’t add back button in left top corner in Settings page. Is it possible to add this back button in settings page, if main page don’t have Navigation Controller? I tried add button to Navigation Controller but I can’t connect it with main-page.
SS below:

If your intention was to enable you to go from the Settings view controller back to the Home view controller by pressing a ‘< Back’ button then embedding Settings in a Navigation Controller is not going to help you because the ‘< Back’ button is never created at the root Viewcontroller level of a Navigation controller.

A better solution would be to remove the Navigation Controller, add a navigation bar to the top of the Settings View Controller and the add a bar button item to that navigation bar (you could name it ‘Back’), connect it to your SettingsViewController.swift file as an action button and add code to dismiss the SettingsViewController like so:

@IBAction func backButton(_ sender: Any) {
    dismiss(animated: true)
}

Does that make sense?

1 Like