Created
June 5, 2016 20:07
-
-
Save vcalfa/604ad808c1795dec4f74255813d8164b 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
// | |
// UIViewControllerExtension.swift | |
// Segue | |
// | |
// Created by Vladimir Calfa on 04/06/16. | |
// Copyright © 2016 Vladimir Calfa. All rights reserved. | |
// | |
import UIKit | |
import Foundation | |
extension UIViewController | |
{ | |
func performSegueWithIdentifier(segueIdentifier: SegueIdentifier, | |
sender: AnyObject?) { | |
performSegueWithIdentifier(segueIdentifier.rawValue, sender: sender) | |
} | |
} | |
extension UIStoryboardSegue { | |
public var segueIdentifier : SegueIdentifier { | |
get { | |
guard let identifier = self.identifier, | |
segueIdentifier = SegueIdentifier(rawValue: identifier) | |
else { | |
fatalError("Invalid segue identifier \(self.identifier).") | |
} | |
return segueIdentifier | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment