Given the 2 classes Foo and Bar, where Bar is a subclass of Foo:
class Foo {
var a: Int?
var b: Int?
init() {
a = 1
}
}
class Bar: Foo {
var c: Int?
override init() {
super.init()
b = 2
c = 3
}
}
Bar(), super.init(), , Foo. , Foo , Foo. a = 1 Foo.
, 2, Bar super.init(). " " , . b = 2 c = 3.
let x = Bar()
x.a
x.b
x.c