您的位置:首页 > 移动开发 > IOS开发

通过代码退出IOS程序

2014-03-24 13:00 232 查看
-(void) tapClick:(UITapGestureRecognizer *)tap{
[UIViewbeginAnimations:@"exitApplication"context:nil];
[UIViewsetAnimationDuration:0.5];
[UIViewsetAnimationDelegate:self];
[UIViewsetAnimationTransition:UIViewAnimationCurveEaseOutforView:self.view.windowcache:NO];
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
//self.view.window.bounds = CGRectMake(0, 0, 0, 0);
self.view.window.bounds = CGRectMake(0, 0, 0, 0);
[UIViewcommitAnimations];
}
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
if ([animationID compare:@"exitApplication"] == 0) {
exit(0);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: