<14>退出当前应用程序

/*
 *退出当前应用程序
 */
+ (void)exitApp;
+ (void)exitApp{
   
    UIWindow *window = [[UIApplication sharedApplication].delegate window];
    //添加动画
    [UIView animateWithDuration:2.0f animations:^{
        window.alpha = 0;
    } completion:^(BOOL finished){
       
        if (finished){
           
            //exit(0):为0时正常运行程序并推出,非0时非正常运行导致程序退出。
            exit(0);
        }
       
    }];
    
}
 
posted @ 2017-04-10 11:58  NextXavier  阅读(263)  评论(0编辑  收藏  举报