Last active
October 14, 2017 21:39
-
-
Save vvit/ea529816bef49a9ff00fb2b4f4ffd815 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if a view controller is popped from navigation stack (either by `popViewController` or interactive transition) | |
// Method 1 | |
override func didMove(toParentViewController parent: UIViewController?) { | |
super.didMove(toParentViewController: parent) | |
if parent == nil { // parent is `nil` when the vc is popped | |
} | |
} | |
// Method 2 | |
override func viewDidDisappear(animated: Bool) { | |
super.viewDidDisappear(animated) | |
if self.isBeingDismissed() || self.isMovingFromParentViewController() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment