Is it possible to call this function during a "swipe, close" event?
I presume by ‘“swipe, close” event’ you mean the user removing the app from the multitasking UI? If so, the answer is “It depends.” To wit:
If you’re app is in the foreground then removing it from the multitasking UI will invoke your
-applicationWillTerminate:
delegate method.Likewise if your app is running in the background, for example, via a
UIApplication
background task.If your app is suspended in the background, it will be removed from memory without any of your code running.
If your app is terminated in the background then, well, it’s already terminated.
Have you thought about using
joinOnce
? This creates a temporary Wi-Fi configuration, one that’s automatically removed once your app is no longer frontmost.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"