https://stackoverflow.com/questions/27713747/execute-action-when-back-bar-button-of-uinavigationcontroller-is-pressed
self.navigationItem.hidesBackButton = true
let newBackButton = UIBarButtonItem(title: "Back", style: UIBarButtonItemStyle.plain, target: self, action: #selector(Quoterequestsend.back(sender:)))
self.navigationItem.leftBarButtonItem = newBackButton
func back(sender: UIBarButtonItem) {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyBoard.instantiateViewController(withIdentifier: "viewcontroller") as! viewcontroller
self.navigationController?.pushViewController(vc, animated: true)
}
No comments:
Post a Comment