6
6
6urkaaa2015-03-21 23:07:29
Swift
6urkaaa, 2015-03-21 23:07:29

How to set interval in switch in Swift?

How to set interval in Switch
(-infinite ; 0 )
[0 ; 1]
(10 ; +infinite)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-03-22
@stringName

switch doubleValue {
case let x where x < 0:
    println(x)
case 0...1:
    println("0...1")
case let x where x > 10:
    println(x)
default:
    println("default")
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question