open new view controller swift on button click with a default back button code example
Example: show back button in navbar swift
let backButton = UIBarButtonItem()
backButton.title = "New Back Button Text"
self.navigationController?.navigationBar.topItem?.backBarButtonItem = backButton