Created
December 25, 2013 14:28
-
-
Save guanqun/8123638 to your computer and use it in GitHub Desktop.
quit ios app with animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)exitApplication { | |
[UIView beginAnimations:@"exitApplication" context:nil]; | |
[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]; | |
} | |
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { | |
if ([animationID compare:@"exitApplication"] == 0) { | |
exit(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment