iOS代碼退出程序一般直接調用exit(0); ,但是視覺上看起來像閃退,於是,我借鑒了下網上別人的代碼,寫了一個向下切出退出程序的方法,代碼如下:
- (void)exitApplication { AppDelegate *app = [UIApplication sharedApplication].delegate; UIWindow *window = app.window; [UIView animateWithDuration:1.0f animations:^{ window.alpha = 0; window.frame = CGRectMake(0, window.bounds.size.width, 0, 0); } completion:^(BOOL finished) { exit(0); }]; }