0
我可以在初始化程序中使用其他初始化程序嗎?在Swift的初始化程序中使用其他類初始化程序
class Car {
var manufacturer:String?
var speed:Int?
init (manufacturer manf:String){
manufacturer = manf
}
init(manufacturer manf:String, speed spd:Int){
manufacturer = manf // How can I use the other initializer here?
speed = spd
}
}
var b = Car(manufacturer: "bmw")
var k = Car(manufacturer: "kia", speed: 30)