0

I want to bring up a confirmation window when moving forward with the back button But you can get back button events, but you can’t stop moving forward.

override func viewWillDisappear(_ animated: Bool) {
       super.viewWillDisappear(animated)
       
     
       if self.isMovingFromParent {
          
       }
       
   }

What should I do?

HUJIN SHIN
  • 63
  • 6
  • 1
    You want a confirmation screen popping up when the user taps the back button instead of regular going back in the navigation, did I understand you correctly here? If so, you need to override the default leftBarButtonItem (the back button). Have a look at here: https://stackoverflow.com/questions/27713747/execute-action-when-back-bar-button-of-uinavigationcontroller-is-pressed – mflknr Jul 27 '20 at 12:27
  • Thanks, I solved it. – HUJIN SHIN Jul 27 '20 at 12:45

0 Answers0