Skip to content

Instantly share code, notes, and snippets.

@kirsteins
Last active August 29, 2015 14:13
Show Gist options
  • Save kirsteins/c37cb3c98a2bac0ad6e0 to your computer and use it in GitHub Desktop.
Save kirsteins/c37cb3c98a2bac0ad6e0 to your computer and use it in GitHub Desktop.
Check when back button has been pressed
public override func viewWillDisappear(animated: Bool) {
if let navigationStackViewControllers = self.navigationController?.viewControllers {
if navigationStackViewControllers.contains(self) == false {
// View controller has been popped as it is not in navigation stack any more
}
}
super.viewWillDisappear(animated)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment