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);
}
}
//来
加个动画,给用户一个友好的退出界面
[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);
}
}
相关文章推荐
- 仿IOS自定义组合Dialog【GroupDialog】(更新版)
- iOS --typedef enum的用法
- ios7导航栏返回按钮的一些问题总结
- IOS开发把一个结构体放到数组中
- iOS开发视图控制器(ViewController)调用[super viewXXX]的简单理解
- iOS与JS交互实战篇(ObjC版)
- IOS学习 使用OCMock单元测试(一)安装
- ios 开发过程中遇到的一些需要注意的地方
- 浅析iOS中实例方法和类方法
- iOS开发 CocoaPods 的安装流程
- 分析iOS Crash文件:符号化iOS Crash文件的3种方法
- iOS取整
- iOS开发资源:VideoPlayerKit、AHAlertView以及REMenu等
- smartsvn解决冲突的方法
- iOS NSURLSession后台下载和断点续传
- 用HTML5/CSS3/JS开发Android/IOS应用框架大全
- IOS中正则表达式的使用
- iOS 单例的滥用和用依赖注入替代
- ios开发技巧之tableView去掉多余的空行分割线 自定义cell分割线
- iOS7上leftBarButtonItem无法实现滑动返回的完美解决方案