objective c - How to call designated superclass initializers in Swift -


in objective-c there standard pattern in initializers call designated initializer of superclass.

for example:

- (instancetype)initwithframe:(cgrect)frame {     self = [super initwithframe:frame];     if (self) {         // initialization code     }     return self; } 

what standard way same initialization in swift class?

like this

init(frame: cgrect) {     super.init(frame: frame)     // initialization code } 

Comments

Popular posts from this blog

ios - Change Storyboard View using Seague -

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -