iOS 动画退出应用代码

2019-07-23    来源:open-open

容器云强势上线!快速搭建集群,上万Linux镜像随意使用


//退出应用

- (void)appExit{

    UIButton *but = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 30)];

    [but setTitle:@"退出此应用" forState:UIControlStateNormal];

    [but setTitleColor:[UIColor redColor] forState:UIControlStateNormal];

    [self.view addSubview:but];

    [but addTarget:self action:@selector(didClicked:) forControlEvents:UIControlEventTouchUpInside];

}


- (void)didClicked:(id)sender{

        [UIView beginAnimations:@"exitApplication" context:nil];

        [UIView setAnimationDuration:0.5];

        [UIView setAnimationDelegate:self];

        [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];

        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view.window cache:NO];

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

        self.view.window.bounds = CGRectMake(0, 0, 0, 0);

        [UIView commitAnimations];

}


标签: [db:TAGG]

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。

上一篇:Python的Mysql connector封装

下一篇:python操作redis代码