调用代码使APP退出进入iPhone手机主屏幕界面
2016-09-22 本文已影响61人
InitWithYou
第一种方法: [[UIApplication sharedApplication]
performSelector:@selector(suspend)];
第二种方法:
- (void)exitApplication {
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
[UIView animateWithDuration:1.0f animations:^{
window.alpha = 0;
} completion:^(BOOL finished) {
exit(0);//退出APP
}];
}