Created
June 13, 2019 18:30
-
-
Save jeksys/238575ab9a90fb5f72d2bb5125b183ca to your computer and use it in GitHub Desktop.
Source of view appear calls
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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
if isMovingToParent { | |
print("isMovingToParent") | |
// this view controller is becoming visible because it was just push onto a navigation controller or some other container view controller | |
} else if isBeingPresented { | |
print("isBeingPresented") | |
// this view controller is becoming visible because it is being presented from another view controller | |
} else if view.window == nil { | |
print("view.window == nil ") | |
// this view controller is becoming visible for the first time as the window's root view controller | |
} else { | |
print("else") | |
// this view controller is becoming visible because something that was covering it has been dismissed or popped | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment