Swift - CancelClose Equivalent?

Does anybody know an acceptable method to stop an iOS App from terminating under specific circumstances?

The termination flow is

  • applicationWillResignActive
  • applicationDidEnterBackground
  • applicationWillTerminate

If a particular flag in the app is set, I need to intercept and ask the user a question, depending on the answer, either go ahead and terminate, or return to active status

but it seems that this is an unstoppable process :frowning:

I was able to do this (well not exactly as CancelClose would have). but in a way that works for this app.


  self.controllerUserInteractionEnabled=false


 func extendedInputDetected(gamepad: GCExtendedGamepad, element: GCControllerElement, index: Int) {
        print(element)
        if element.description.contains("Home") {
1 Like