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

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -