Skip to content

ipagong/PGEZTransition

Repository files navigation

PGEZTransition

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

it's viewcontroller transitioning with protocol.

you need to use views that realized the protocol. (PGTransformal)

Requirements

above

  • swift 4.0
  • xCode 9.3

Installation

PGEZTransition is available through CocoaPods.
To install it, simply add the following line to your Podfile:

pod 'PGEZTransition'

How to Use

  1. Setup views on interfacebuild (or programatically)

ViewSetup

  1. Setup custom class at "inspector" (if you use UILabel, use PGTransformLabel)

ViewSetup

  1. Setup transform value & alpha
class IntroSecondController: UIViewController {
    
    //connect IBOutlet
    @IBOutlet weak var titleTop: PGTransformLabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
    
        // Setup view transform.
        titleTop
            .setStartTransform(.y(15), start: 0.3, duration: 0.4)
            .setStartAlpha(0.0, start: 0.2, duration: 0.4)
            .setEndTransform(.zero, start: 0.0, duration: 1.0)
            .setEndAlpha(1.0, start: 0.0, duration: 1.0)
            
        ...
    }
}
  1. Connect Each ViewController ( target vc < - > will present vc )
class IntroFirstController: UIViewController {
    //Animator
    private var transition:PGTransformTransition!
    
    //next view controller 
    private lazy var nextVc:IntroSecondController = {
        return UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "IntroSecondController") as! IntroSecondController
    } ()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //setup
        self.transition = PGTransformTransition(target: self, presenting: self.nextVc)
    }
}

Demo

PGEZTransition Preview

appetize.io demo : [ here ]

Author

suwan.park, ipagong.dev@gmail.com

License

PGEZTransition is available under the MIT license. See the LICENSE file for more info.

About

Easy Transform Transition (iOS)

Resources

License

Stars

Watchers

Forks

Packages

No packages published