In my iOS app, things are mostly driven by events.
- The user presses a button
- The app listens for an external device to be connected to the iOS device
- Once the device is detected (is connected), an asynchronous call is made to a web service (to check for user authenticity)
- The web service returns the user's authenticity (such as a boolean)
- Another asynchronous web service is called for a stage 2 authenticity
- Result is returned
My question is: If I give the user a dialog box saying "Please wait, processing" and I give them a "Cancel" button, how should I (or how might I) abort everything that's happening?
One way to do this is to simply have a boolean called "userDidCancelEverything" and every event-driven method checks to see if this is true. This seems ugly though.