let testing = TestObject()
testing.testA()
testing.testB()
Slide 46
Slide 46 text
testing.testB = testing.testA
Slide 47
Slide 47 text
testing.testB()
// Actually calls testA
Slide 48
Slide 48 text
CONSISTENCY
Slide 49
Slide 49 text
FUNCTIONAL
Slide 50
Slide 50 text
No content
Slide 51
Slide 51 text
let string = "Hello World"
let matches:[NSTextCheckingResult] = /* regex for words in string */
matches.map {
string.substringWithRange($0.range)
}
Slide 52
Slide 52 text
let string = "Hello World"
let matches:[NSTextCheckingResult] = /* regex for words in string */
var strings = [String]()
for match in matches {
let catch = string.substringWithRange(match.range)
strings.append(catch)
}
let point = (1, 2)
switch point {
case (0, 0):
println("(0, 0) is at the origin.")
case (-2...2, -2...2):
println("(\(point.0), \(point.1)) is near the origin.")
default:
println("The point is at (\(point.0), \(point.1)).")
}
// prints "(1, 2) is near the origin."