我有一个泛型类,我希望能够与默认类型一起使用.现在我可以用任何类型初始化它,但我必须是显式的.
//Initialize with a type
MyManager<MyCustomerObject>()
// Initialize with NSObject (what I want to be my default type)
MyManager<NSObject>()
// This doesn't work, but I want this kind of functionality
class MyManager<T = NSObject> {}
// So I can create my manager like so and it inserts the default type as NSObject
MyManager() //Or MyManager<>()
这在Swift 有可能吗?