I'm working on an app that presents a "Sign In" view controller from a tab bar controller. The user has to sign in before doing anything. Normally the user complets the sign in process and that sign in view controller is dismissed and the user can enjoy all the goodness of the things on the tab bar controller.
Note: It's not easy, so far, for us to revise our view hierarchy and we'd really like to keep it.
The problem is that if the user presses Menu on the remote control, while on the Sign In screen, they arrive at the tab bar's contents but haven't signed in yet. That's no good. We need the user to complete sign in before seeing that stuff. It's easy for us to add a gesture recognizer to disallow use of the Menu button on the Sign In screen. However, it feels like the Menu button should exit the app at this point because there's nothing else the user can do unless they sign in. So if the user presses Menu from the Sign In screen we'd like to exit the app, but need to that with our own code and can't rely on the system handling it since this view controller isn't the root one.
As far as I know there's no approved way to tell our tvOS app to exit gracefully or to pass that menu button press on up to the next view controller. We can use "exit()" but of course that's like a crash and the transition out of the app looks weird.
Key questions:
- Is there any way to tell a tvOS app to exit so that we can handle the Menu button in the way a user will expect in cases like this where our view hierarchy doesn't exactly match how the Menu button works?
- Besides redoing our view hierarchy... is there some other solution that you can suggest?