- (void)exitApplication {
[UIView beginAnimations:@"exitApplication" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
// [UIView setAnimationTransition:UIViewAnimationCurveEaseOut forView:self.view.window cache:NO];
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
// [UIView setAnimationTransition:UIViewAnimationCurveEaseIn forView:window cache:NO];
//
// [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
//
// //self.view.window.bounds = CGRectMake(0, 0, 0, 0);
//
// window.bounds = CGRectMake(0, 0, 0, 0);
//
// [UIView commitAnimations];
[UIView animateWithDuration:1.0f animations:^{
window.alpha = 0;
window.frame = CGRectMake(0, window.bounds.size.width, 100, 0);
} completion:^(BOOL finished) {
exit(0);
}];
//exit(0);
//
}
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
if ([animationID compare:@"exitApplication"] == 0) {
exit(0);
}
[UIView beginAnimations:@"exitApplication" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
// [UIView setAnimationTransition:UIViewAnimationCurveEaseOut forView:self.view.window cache:NO];
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
// [UIView setAnimationTransition:UIViewAnimationCurveEaseIn forView:window cache:NO];
//
// [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
//
// //self.view.window.bounds = CGRectMake(0, 0, 0, 0);
//
// window.bounds = CGRectMake(0, 0, 0, 0);
//
// [UIView commitAnimations];
[UIView animateWithDuration:1.0f animations:^{
window.alpha = 0;
window.frame = CGRectMake(0, window.bounds.size.width, 100, 0);
} completion:^(BOOL finished) {
exit(0);
}];
//exit(0);
//
}
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
if ([animationID compare:@"exitApplication"] == 0) {
exit(0);
}
}