UIStoryboard
-
Get the application’s main storyboard Usage: let storyboard = UIStoryboard.mainStoryboard
Declaration
Swift
public static var mainStoryboard: UIStoryboard?
-
Get view controller from storyboard by its class type Usage: let profileVC = storyboard!.instantiateVC(ProfileViewController) /* profileVC is of type ProfileViewController */ Warning: identifier should match storyboard ID in storyboard of identifier class
Declaration
Swift
public func instantiateVC<T>(_ identifier: T.Type) -> T?