Skip to content

Instantly share code, notes, and snippets.

@morpheby
Created February 11, 2019 16:19
Show Gist options
  • Save morpheby/9745e7df426e1fc24e03d0a290b5c245 to your computer and use it in GitHub Desktop.
Save morpheby/9745e7df426e1fc24e03d0a290b5c245 to your computer and use it in GitHub Desktop.
import Foundation
extension UIViewController {
func wire(segue: UIStoryboardSegue, with sender: Any?) {
guard let activationClosure = sender as? (UIViewController) -> Void else {
fatalError("Architectural failure. Can't prepare router")
}
activationClosure(segue.destination)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment