How to use initializers without using argument labels in Swift?

We can avoid the argument label in initializer definition by replacing it with an underscore _. While initializing the type, we can simply provide the value for the initializer without mentioning argument label. This is different from not specifying the argument labels for the initializers as in this case, the parameter name will be used as default argument label by the Swift compiler.

Leave a Reply