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

iOS代码强制退出程序

2016-03-16 15:42 253 查看
- (void)exitApplication {

//来
加个动画,给用户一个友好的退出界面

[UIView
beginAnimations:@"exitApplication"
context:nil];

[UIView
setAnimationDuration:0.5];

[UIView
setAnimationDelegate:self];

// [UIView setAnimationTransition:UIViewAnimationCurveEaseOut forView:self.view.window cache:NO];

[UIView
setAnimationTransition:UIViewAnimationCurveEaseOut
forView:appDelegate.window
cache:NO];

[UIView
setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];

//self.view.window.bounds = CGRectMake(0, 0, 0, 0);

appDelegate.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);

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: