During an all-hands meeting in June 2014, our iOS Engineer Thomas Visser (@thomvis) talked about the newly introduced Swift programming language. The goal of the talk was to explain the impact that Swift will have to the whole team.
The intended audience is a multi-disciplinary team, consisting of designers, developers and product people that are involved in making great apps.
Some slides were augmented or added to accommodate for the lack of audio. If you have any questions or comments, please let me know at @thomvis88 or @touchwonders.
3. A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
1995 2009
Go
2003
Scala
2000
C#
Java
Ruby
4. A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
1995 2009
Go
2003
Scala
2000
C#
Java
Ruby
Windows PhoneAndroid
Web
iOS
5. A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
Java
Ruby
2009
Go
2003
Scala
2000
C# Swift
20141995
6. A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
Java
Ruby
2009
Go
2003
Scala
2000
C# Swift
20141995
Windows PhoneAndroidiOS
Web
iOS
7. - Generics!
- Closures!
- Type inference!
- Multiple return types!
- Namespaces!
- Mutability syntax
Swift Features
8. class Future<T> {
typealias Callback = (future: Future<T>) -> ()
!
let q = Queue()
var result = TaskResult<T>()
var callbacks: Array<Callback> = Array<Callback>()
let defaultCallbackExecutionContext = QueueExecutionContext()
class func succeeded(value: T?) -> Future<T> {
let res = Future<T>();
res.result = TaskResult(value: value)
return res
}
class func failed(error: NSError) -> Future<T> {
let res = Future<T>();
res.result = TaskResult(error: error)
return res
}
}
Looking at Swift
33. Strict & Modern
Imagine a future Photoshop where you can never
give something a color, without defining a swatch
first. In this tool, it is equally impossible to create a
label with an arbitrary font style. Fonts styles and
colors are created and edited in a central place.
Changes propagate to all usages of that color or
font style.
This tool, like Swift, protects you from introducing
inconsistency in your design.
34. let names = ["Steve", "Tim"]
for name in names {
println("Hello (name)")
}
NSArray *names = @[@"Steve", @"Tim"];
for (NSString *name in names) {
NSLog(@"Hello %@", name);
}
Objective-C
Swift
Clean