问题
I love Swift, except for this
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
If I create any UIViewController extended class I have to have this ugly, unclear, required init, as the init I don't want.
Is there a way I can set up my code so I can have code setup so I can have my own required init, and then it just calls this at the end? I don't want my client code to have to deal with this, and I'd like to have one clear init() call, instead of a 'initWithSomeCumbersomeName()' call.
If anyone has a clean workaround to this I am all ears!
来源:https://stackoverflow.com/questions/26394009/create-a-uiviewcontroller-extended-class-with-a-custom-initializer