Latest 1.0.4
Homepage https://github.com/ladeiko/ImmediateAnimationController
License CUSTOM
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

Implementation of object supporting UIViewControllerAnimatedTransitioning without animation. It can be useful to
show some controllers immediately.

Example

MyViewController will be shown immediately as transparent and then it will present
SomeControllerController accordingly to animated flag.

import ImmediateAnimationController // if used as Cocoapod

class MyViewController: UIViewController, UIViewControllerTransitioningDelegate {

    // MARK: Life cycle
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)

        transitioningDelegate = self
        definesPresentationContext = true
        modalPresentationStyle = .overCurrentContext

        if UIDevice.current.userInterfaceIdiom == .pad {
            modalTransitionStyle = .coverVertical
        }
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    // MARK: Life cycle
    override func viewDidLoad() {
        super.viewDidLoad()
        view.isOpaque = false
        view.backgroundColor = .clear
    }

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)

        let controller = SomeControllerController()
        present(controller, animated: animated, completion: nil)
    }

    // MARK: - UIViewControllerTransitioningDelegate

    func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return ImmediateAnimationController.shared
    }

    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return ImmediateAnimationController.shared
    }

}

Latest podspec

{
    "name": "ImmediateAnimationController",
    "version": "1.0.4",
    "summary": "ImmediateAnimationController implements UIViewControllerAnimatedTransitioning without any animation",
    "homepage": "https://github.com/ladeiko/ImmediateAnimationController",
    "license": {
        "type": "CUSTOM",
        "file": "LICENSE"
    },
    "authors": {
        "Siarhei Ladzeika": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/ladeiko/ImmediateAnimationController.git",
        "tag": "1.0.4"
    },
    "source_files": "Classes/**/*.{m,s,swift}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This