首页 > 学院 > 开发设计 > 正文

通过代码退出IOS程序

2019-11-14 20:35:30
字体:
来源:转载
供稿:网友
-(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);    }}

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表