9.1.2. Initializing structs with different initializers
struct Car{
var make:String
var model:String
var year:Int
init(){
make = "Not set"
model = "Not set"
year = 0
}
}
//creating an instance of Car...
var car = Car()
//printing the instance...
print(car)
Struct initialization and Optionals

Source code
Previous9.1.1. Functions (methods) inside structsNext9.1.3. Manipulating object properties inherently in a struct
Last updated