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)
above
- swift 4.0
- xCode 9.3
PGEZTransition is available through CocoaPods.
To install it, simply add the following line to your Podfile:
pod 'PGEZTransition'
- Setup views on interfacebuild (or programatically)
- Setup custom class at "inspector" (if you use UILabel, use PGTransformLabel)
- 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)
...
}
}
- 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)
}
}
appetize.io demo : [ here ]
suwan.park, ipagong.dev@gmail.com
PGEZTransition is available under the MIT license. See the LICENSE file for more info.