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
Post a Comment