Last active
January 13, 2018 14:12
-
-
Save agoiabel/762af989d8070e409780deaea606964e to your computer and use it in GitHub Desktop.
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
func dayType(for day: String) -> String { | |
switch day { | |
case: "Saturday", "Sunday": return "Weekend" | |
case: "Monday", "Tuesday", "Wednessday", "Thursday", "Friday": return "Weekday" | |
default: return "This is not a valid date" | |
} | |
} | |
let result1 = dayType(for: "Sunday") //will return "Weekend" | |
let result2 = dayType(for: "Thursday") //will return "Weekday" | |
let result3 = dayType(for: "fridayys") //will return "This is not a valid date" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment