Return instancetype in Swift
问题 I\'m trying to make this extension: extension UIViewController { class func initialize(storyboardName: String, storyboardId: String) -> Self { let storyboad = UIStoryboard(name: storyboardName, bundle: nil) let controller = storyboad.instantiateViewControllerWithIdentifier(storyboardId) as! Self return controller } } But I get compile error: error: cannot convert return expression of type \'UIViewController\' to return type \'Self\' Is it possible? Also I want to make it as init