Skip to content

Instantly share code, notes, and snippets.

@BlueMilkApps
Last active December 29, 2015 14:49
Show Gist options
  • Save BlueMilkApps/cf1f9c6d945b8df0df1b to your computer and use it in GitHub Desktop.
Save BlueMilkApps/cf1f9c6d945b8df0df1b to your computer and use it in GitHub Desktop.
import UIKit
class PrimaryViewController: UIViewController, Dimmable {
let dimLevel: CGFloat = 0.5
let dimSpeed: Double = 0.5
override func viewDidLoad() { super.viewDidLoad() }
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }
// MARK: - Segues
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
dim(.In, alpha: dimLevel, speed: dimSpeed)
}
@IBAction func unwindFromSecondary(segue: UIStoryboardSegue) {
dim(.Out, speed: dimSpeed)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment