Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add push with dissolve animated #22

Open
Morbix opened this issue Aug 20, 2016 · 0 comments
Open

Add push with dissolve animated #22

Morbix opened this issue Aug 20, 2016 · 0 comments

Comments

@Morbix
Copy link
Member

Morbix commented Aug 20, 2016

    func pushFadeViewController(viewController: UIViewController) {
        self.view.layer.addAnimation(self.fadeTransaction(), forKey: nil)
        self.pushViewController(viewController, animated: false)
    }

    func popFadeViewController() {
        self.view.layer.addAnimation(self.fadeTransaction(), forKey: nil)
        self.popViewControllerAnimated(false)
    }

    func popFadeToRootViewController() {
        self.view.layer.addAnimation(self.fadeTransaction(), forKey: nil)
        self.popToRootViewControllerAnimated(false)
    }

    func fadeTransaction() -> CATransition {
        let transition = CATransition()
        transition.duration = 0.3
        transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
        transition.type = kCATransitionFade
        return transition
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant