Skip to content

Instantly share code, notes, and snippets.

@vineethvijayan
Created August 23, 2021 08:23
Show Gist options
  • Save vineethvijayan/6e47bc4805560b0925339c9edb894ef7 to your computer and use it in GitHub Desktop.
Save vineethvijayan/6e47bc4805560b0925339c9edb894ef7 to your computer and use it in GitHub Desktop.
Enum, Loop, Equatable
import UIKit
//var str = "Hello, playground"
enum direction: String, CaseIterable {
case north
case south
case east
case west
}
var d = "north"
for item in direction.allCases {
print(item)
}
if(d == direction.north.rawValue) {
print("true")
} else {
print("false")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment