More Related Content
Similar to Keynote - TDC2015 (20)
More from Mauricio Tremea Zaquia (6)
Keynote - TDC2015
- 4. Search extensibility
Swift 2
Third-Party Notifications
App Thinning
New multitasking APIs
GameplayKit
Layout Guides
Stack Views
Storyboard References
Content blockers
On-demand resources
Safari View Controller
Wallet
CloudKit ReplayKit
- 5. Search extensibility
Swift 2
Third-Party Notifications
App Thinning
New multitasking APIs
GameplayKit
Layout Guides
Stack Views
Storyboard References
Content blockers
On-demand resources
Safari View Controller
Wallet
CloudKit ReplayKit
- 12. let x = "The Developers Conference"
for (index, c) in enumerate(x) {
if c == "e" {
println(index)
}
}
// 2, 5, 7, 11, 19, 21, 24
- 13. let x = "The Developers Conference"
for (index, c) in x.characters.enumerate() where c == "e" {
print(index)
}
// 2, 5, 7, 11, 19, 21, 24
- 14. enum DivisionError: ErrorType {
case ByZero
}
func divide(dividend: Float, by divisor: Float) throws -> Float {
guard divisor != 0.0 else {
throw DivisionError.ByZero
}
return dividend / divisor
}
func makeItHappen() {
defer { print("The division method was called") }
do {
try divide(4, by: 0)
} catch DivisionError.ByZero {
print("Division by zero is not allowed")
} catch {}
}