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
initialization ios xcode uiviewcontroller swift


source to share


No one has answered this question yet

See similar questions:

3
Quick use of the unimplemented 'init ()' initializer

or similar:

2583
Initializing an array in one line
1513
JavaScript checks if a variable exists (defined / initialized)
924
How do I initialize all elements of an array to the same value?
870
Swift Beta: Sorting Arrays
828
How do I directly initialize a HashMap (literally)?
67
Custom init for UIViewController in Swift with UI customization in storyboard
eleven
How to override UIView initializer in Swift 1.0
6
IBOutlets and IBactions require! at the end
1
Create custom table cell with swift
0
Failed to instantiate for viewcontroller in other view controllers in Swift



All Articles
Loading...
X
Show
Funny
Dev
Pics