CustomSegue
Custom segue for OSX Storyboards with slide and cross fade effects.
class MyViewController: NSViewController {
override func prepareForSegue(segue: NSStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "configured" {
if let segue = segue as? PresentWithAnimatorSegue, animator = segue.animator as? TransitionAnimator {
animator.duration = 1
animator.transition = [.SlideDown/, .Crossfade]
animator.backgroundColor = NSColor(calibratedRed: 1, green: 0, blue: 0, alpha: 0.5)
animator.keepOriginalSize = true
animator.removeFromView = false
}
}
}
Segue transition is configured via NSViewControllerTransitionOptions
How to use
Use PresentWithAnimatorSegue
in your storyboard or use one of already configured segue: SlideDownSegue
, SlideUpSegue
,...
Installation
Using CocoaPods
CocoaPods is a centralized dependency manager for Objective-C and Swift. Go here to learn more.
-
Add the project to your Podfile.
use_frameworks! pod 'CustomSegue'
-
Run
pod install
and open the.xcworkspace
file to launch Xcode.