iOS强制退出APP并添加比较友善的动画
直接贴代码
// 退出应用程序
- (void)exitApplication
{
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
[UIView animateWithDuration:0.4f animations:^{
CGAffineTransform curent = window.transform;
CGAffineTransform scale = CGAffineTransformScale(curent, 0.1,0.1);
[window setTransform:scale];
} completion:^(BOOL finished) {
exit(0);
}];
}