Dismiss pushed view from within Navigation Controller Dismiss pushed view from within Navigation Controller ios ios

Dismiss pushed view from within Navigation Controller


Obtain a reference to your UINavigationController and call

- (UIViewController *)popViewControllerAnimated:(BOOL)animated

on it.


In Swift it would be calling the method

navigationController?.popViewController(animated: true)


If we use push segue, then use popViewController

@IBAction func backButtonClicked(_ sender: Any) {    self.navigationController?.popViewController(animated: false)}