Skip to content

Instantly share code, notes, and snippets.

@yunustek
Last active October 7, 2018 16:49
Show Gist options
  • Save yunustek/4d5d314da35b47d0a149b7d6941b20ab to your computer and use it in GitHub Desktop.
Save yunustek/4d5d314da35b47d0a149b7d6941b20ab to your computer and use it in GitHub Desktop.
Derived Collection of Enum Cases
enum Cities: CaseIterable {
static var allCases: [Cities] {
return [.antwerp, .brussels, .mumbai, .hyderabad(countryName: "India")]
}
case antwerp
case brussels
case mumbai
case hyderabad(countryName: String)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment