用代码控制退出APP
+ (void)exitApplication {
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
[UIView animateWithDuration:0.4f animations:^{
window.alpha = 1;
CGFloat y = window.bounds.size.height;
CGFloat x = window.bounds.size.width / 2;
window.frame = CGRectMake(x, y, 0, 0);
} completion:^(BOOL finished) {
exit(0);
}];
}
让天下没有难写的代码