How to create swift class for category?
问题 I want to create category of my existing swift class, but there is no option in IDE to do so. Any idea if category exists in swift project? Or how to achieve similar functionality in swift project? 回答1: In Swift, you can use Extensions to add new functionality to existing classes, structs and enumeration types. They differ from Objective-C categories in a few ways, mainly: They aren't named You don't need to import an Extension explicitly. If you define an extension to add new functionality