How to customize initialization with optional property values in Swift?

If we know that a property inside a type may at some point of time can have “no value” , then we can declare such property as optional property. During initialization of type instance, that property will be assigned nil.

 

 

Leave a Reply