Created
February 18, 2017 08:05
-
-
Save ANNotunzdY/d94189ced945868e9e3d7649993c7a28 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
import UIKit | |
extension UIStoryboard { | |
func instantiate<T: UIViewController>(for type: T.Type) -> T? { | |
let name = NSStringFromClass(type) | |
let vc = instantiateViewController(withIdentifier: name) | |
return vc as? T | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment