iOS 强制退出APP

2020-12-24  本文已影响0人  缘來諟夢

方法一:

// 退出应用程序
- (void)exitApplication{
    AppDelegate *app = (AppDelegate*)[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);
    }];
}

方法二:

[[UIApplication sharedApplication] terminateWithSuccess];
上一篇 下一篇

猜你喜欢

热点阅读