Skip to content

Instantly share code, notes, and snippets.

@vcalfa
Created June 5, 2016 20:07
Show Gist options
  • Save vcalfa/604ad808c1795dec4f74255813d8164b to your computer and use it in GitHub Desktop.
Save vcalfa/604ad808c1795dec4f74255813d8164b to your computer and use it in GitHub Desktop.
//
// 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