Skip to content

Instantly share code, notes, and snippets.

@zhaozzq
Last active August 21, 2020 09:06
Show Gist options
  • Save zhaozzq/759b0fd53d54822df77016c03b8aa709 to your computer and use it in GitHub Desktop.
Save zhaozzq/759b0fd53d54822df77016c03b8aa709 to your computer and use it in GitHub Desktop.
UIViewController 第一次 viewDidApear
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        if self.isBeingPresented || self.isMovingToParent {
            //Perform an action that will only be done once
        } 
    }
     if (!self.isBeingPresented && !self.isMovingToParentViewController) {
         //except first time
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment