Created
August 23, 2021 08:23
-
-
Save vineethvijayan/6e47bc4805560b0925339c9edb894ef7 to your computer and use it in GitHub Desktop.
Enum, Loop, Equatable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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