Created
April 26, 2015 15:12
-
-
Save andreinechaev/d23dc7e5baf216016d40 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import UIKit | |
let days = [1, 2, 3, 4, 5, 6, 7] | |
for day in days { | |
switch day { | |
case 1...5: | |
println("Weekday") | |
case 5, 7: | |
println("Weekend") | |
default: | |
println("Not a day") | |
} | |
} | |
let daysAsString = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] | |
for index in 1...daysAsString.count { | |
switch index { | |
case 1...5: | |
println("Weekday") | |
case 5, 7: | |
println("Weekend") | |
default: | |
println("Not a day") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment