Swift - How to override an init function? (Was a category in Objective-C)
问题 I have an Objective-C category used to customise UIStoryboard's '+ (UIStoryboard *)storyboardWithName:(NSString *)name'. It is used to determine which storyboard file to call when dealing with multiple devices. Now I need to change it to Swift. It seems that I need to create a " Swift Extension ", but am having issues getting it to work. Here is what I have: extension UIStoryboard { convenience init(name: String, storyboardBundleOrNil: NSBundle?) { var storyboard: UIStoryboard? var