Swift extension for selected class instance
问题 In Objective-C category, you can bring in the extended capability introduced by the category methods by including the header of the category in your class. It seems like all Swift extensions are automatically introduced without import. How do you achieve the same thing in Swift? For example: extension UIView { // only want certain UIView to have this, not all // similar to Objective-C, where imported category header // will grant the capability to the class func extraCapability() { } } 回答1: