Provides an animated effect on the app's mandatory exit operation

Source: Internet
Author: User

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
    1. -  (void) exitapplication {   
    2.     [uiview beginanimations:@
    3.     [uiview  setanimationduration:0.5];  
    4.     [uiview setanimationdelegate : self];  
    5.     [uiview setanimationtransition: uiviewanimationcurveeaseout forview:self.window cache:no];  
    6.      [uiview setanimationdidstopselector: @selector (animationFinished:finished:context:)];  
    7.     self.window.bounds = cgrectmake (0, 0, 0,  0);   
    8.     [uiview commitanimations];  
    9. }  

Provides an animated effect on the app's mandatory exit operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.