Swift has this handy syntax:
enum Foo {
case bar
case baz
}
func hoge(foo: Foo) {
}
hoge(foo: .bar) //
It is called an implicit member expression. From the grammar section of the language guide:
An implicit member expression is an abbreviated way to access a member of a type, such as an enumeration case or a type method, in a context where type inference can determine the implied type. It has the following form:
.
member name
For example:
var x = MyEnumeration.someValue x = .anotherValue
From Apple's Swift book:
The values defined in an enumeration (such as north, south, east, and west) are its enumeration cases.