Custom class clusters in Swift
问题 This is a relatively common design pattern: https://stackoverflow.com/a/17015041/743957 It allows you to return a subclass from your init calls. I'm trying to figure out the best method of achieving the same thing using Swift. I do know that it is very likely that there is a better method of achieving the same thing with Swift. However, my class is going to be initialized by an existing Obj-C library which I don't have control over. So it does need to work this way and be callable from Obj-C.