Created
May 10, 2016 11:21
-
-
Save bmoliveira/ae042318b909f398eadadc26cb0a0b3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleViewController: UIViewController { | |
@IBOutlet weak var collectionView: UICollectionView! | |
// the compiler will now complain if you don't have this implemented | |
// you need this to conform to SegueHandlerType | |
enum SegueIdentifier: String { | |
case TheRedPillExperience | |
case TheBluePillExperience | |
} | |
override func viewDidLoad() { | |
title = "Example title".localized() | |
collectionView.registerCell(ExampleCell) | |
} | |
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
switch segueIdentifierForSegue(segue) { | |
case .TheRedPillExperience: | |
print("😈") | |
case .TheBluePillExperience: | |
print("👼") | |
} | |
} | |
@IBAction func onRedPillButtonTap(sender: AnyObject) { | |
performSegueWithIdentifier(.TheRedPillExperience, sender: self) | |
} | |
@IBAction func onBluePillButtonTap(sender: AnyObject) { | |
performSegueWithIdentifier(.TheBluePillExperience, sender: self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment