Create extended UIViewController class using custom initializer

I love Swift apart from this

 required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

      

If I create any extended UIViewController class, I must have this ugly, obscure, required init as init I don't want.

Is there a way that I can tweak my code so that I have a code setup so I can have my own required init and then it just calls it at the end? I don't want my client code to deal with this, and I would like to have one clean call to init () instead of calling initWithSomeCumbersomeName ().

If anyone has a clean workaround, I'm all ears!

+3


source to share





All Articles