Detect if view controller is being popped of from the navigation controller

override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) self.resignFirstResponder() //Is popped to the preview screen in the stack if self.isMovingFromParentViewController == true { print("View controller was popped") } else { print("New view controller was pushed") } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.