iOS之exit(0)动画退出应用程序

来源:互联网 发布:淘宝访客量有什么用 编辑:程序博客网 时间:2024/05/21 11:20

-(void)animationFinished:(NSString*)animationid finished:(NSNumber*)finished

context:(void*)context

{

   if ([animationidcompare:@"exitApplication"]==0) {

      exit(0);// 退出应用程序

       NSLog(@"stop");

    }

}

-(IBAction)exit:(id)sender

{

   [UIViewbeginAnimations:@"exitApplication"context:nil];    //动画名称

    [UIViewsetAnimationDuration:6];

    [UIViewsetAnimationDelegate:self];

    [UIViewsetAnimationTransition:UIViewAnimationCurveEaseInOutforView:self.viewcache:NO]; // 动画方式

//动画结束执行的操作

 [UIVie setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];


   self.view.bounds=CGRectMake(0,0,0, 0);//动画结束

    [UIViewcommitAnimations];

    

}


原创粉丝点击