Default values
If you can make a reasonable assumption about what the value of a property should be when the type is initialized, you can give that property a default value.
It doesn’t make sense to create a default name or email address for a contact, but imagine there’s a new property type to indicate what kind of contact it is:
struct Contact {
var fullName: String let emailAddress: String var type = "Friend"
}
By including the assignment in the definition of type, you give this property a default value. Any contact created from here on will automatically be a friend, unless you change the default value of type to something like “Work” or “Family”.
The downside is that the automatic initializer doesn’t notice default values, so you’ll still need to provide a value for each property unless you create your own custom initializer. You’ll learn more about creating initializers in the next chapter.