·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> app软件开发 >> IOS开发 >> 通过代码退出IOS程序

通过代码退出IOS程序

作者:佚名      IOS开发编辑:admin      更新时间:2022-07-23
-(void) tapClick:(UITapGestureRecognizer *)tap{
    [UIViewbeginAnimations:@"exitapplication"context:nil];
    [UIViewsetAnimationDuration:0.5];
    [UIViewsetAnimationDelegate:self];
     [UIViewsetAnimationTransition:UIViewAnimationCurveEaSEOutforView:self.view.windowcache:NO];
    [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
    //self.view.window.bounds = CGRectMake(0, 0, 0, 0);
    self.view.window.bounds = CGRectMake(0, 0, 0, 0);
    [UIViewcommitAnimations];
}
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
    if ([animationID compare:@"exitApplication"] == 0) {
        exit(0);
    }
}