Skip to content

Instantly share code, notes, and snippets.

@erolando
Forked from KentarouKanno/Pop or Dismiss.swift
Created September 23, 2021 13:22
Show Gist options
  • Save erolando/2f4274af8a33df5b31f5a89ee0171434 to your computer and use it in GitHub Desktop.
Save erolando/2f4274af8a33df5b31f5a89ee0171434 to your computer and use it in GitHub Desktop.
UINavigationController Pop or UIViewController dismiss
// Check UINavigationController Pop or UIViewController dismiss
override func viewDidDisappear(animated: Bool) {
super.viewDidDisappear(animated)
let vcs = self.navigationController?.viewControllers
if ((vcs?.contains(self)) == nil) {
print("UINavigationController Pop")
} else {
print("UIViewController dismiss")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment