If you make B init a convenience init , it will not mask the original init , and you can do it ...
class A { var b: Bool? = nil init(aBool: Bool? = false) { self.b = aBool } } class B: A { var s: String? = nil convenience init(aString: String) { self.init(aBool: false) self.s = aString } } let obj1 = A(aBool: true)
You need to be careful by default or otherwise set all properties, though ...
Alternatively, you can override original init in B and just call super.init .
source share