2015年9月3日 星期四

[iOS]退出App動畫

Objective-C:


        UIWindow *window = [UIApplication sharedApplication].delegate.window;
        [UIView animateWithDuration:1.0f animations:^{
            window.alpha = 0;
            window.frame = CGRectMake(window.bounds.size.width / 2, window.bounds.size.height / 2, 0, 0);
            } completion:^(BOOL finished) {
            exit(0);
        }];

Swift:

        let window:UIWindow = ((UIApplication.sharedApplication().delegate?.window)!)!
        UIView.animateWithDuration(1, animations: {
            window.alpha = 0
            window.frame = CGRectMake(window.bounds.size.width / 2, window.bounds.size.height / 2, 0, 0)
            }, completion: {
                void in exit(0)
        })


reference:http://blog.eyrefree.org/articles/153.html

[iOS]退出App動畫

Objective-C:         UIWindow *window = [UIApplication sharedApplication].delegate.window;         [UIView animateWi...