Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VladimirBrejcha/1d0fe28cc39f84ad207d2a1c3a44c7e3 to your computer and use it in GitHub Desktop.
Save VladimirBrejcha/1d0fe28cc39f84ad207d2a1c3a44c7e3 to your computer and use it in GitHub Desktop.
import UIKit
extension UIStoryboard {
func instantiateViewController<Type: UIViewController>(of type: Type.Type) -> Type {
instantiateViewController(withIdentifier: String(describing: type)) as! Type
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment