There is also a way to exit the program, that is, the use of the open API, this method is more unreliable, because the use of the Open API is not available through the AppStore, and I in the 4.0 version of the experiment is not valid.
You can only exit the app using exit (0). Given that this is only a lack of animation when exiting, you can add an animation, and then call exit when the animation is finished.
In the actual development process may have more than one end login, this time will be forced to squeeze offline, how to prompt and then exit the application will make the user experience is not harmonious, for this we can add some animation effect to give users a more user-friendly experience;
View Plaincopy
- - (void) exitapplication {
- [uiview beginanimations:@
- [uiview setanimationduration:0.5];
- [uiview setanimationdelegate : self];
- [uiview setanimationtransition: uiviewanimationcurveeaseout forview:self.window cache:no];
- [uiview setanimationdidstopselector: @selector (animationFinished:finished:context:)];
- self.window.bounds = cgrectmake (0, 0, 0, 0);
- [uiview commitanimations];
- }
Provides an animated effect on the app's mandatory exit operation