Swift
June, 2014
Thomas Visser
http://giphy.com/gifs/apple-WB8mx9xfVN9AY
A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
1995 2009
Go
2003
Scala
2000
C#
Java
Ruby
A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
1995 2009
Go
2003
Scala
2000
C#
Java
Ruby
Windows Pho...
A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
Java
Ruby
2009
Go
2003
Scala
2000
C# Swift
20141995
A Brief History of Programming Languages
C
1972 1983
Objective-C
C++
Java
Ruby
2009
Go
2003
Scala
2000
C# Swift
20141995
W...
- Generics!
- Closures!
- Type inference!
- Multiple return types!
- Namespaces!
- Mutability syntax
Swift Features
class Future<T> {
typealias Callback = (future: Future<T>) -> ()
!
let q = Queue()
var result = TaskResult<T>()
var callba...
We create great apps
Xcode
Objective-C
iOS
App
Xcode
Xcode + toolchain
Objective-C
iOS
Animations
Data Storage
Receiving/Sending notifications
Location Services
Media Player
Address Book Access
Calendar Acc...
App
Xcode
Objective-C
iOS
App
/ Swift
Xcode
Objective-C
iOS
App
/ Swift
AppCode
Highstreet, Weeronline HD, etc.
It’s a big deal
We don’t usually switch languages
A photographer gets a brand new camera
A designer switches from Photoshop to
a different program
A cyclist switches to new gear shifting mechanics
Learn the new thing
Apply your trade
The new tool
for building
great apps
better
Greatness of apps
Quality of Objective-C code
Quality of Swift code
By approximation
Same Language Different Language
Same!
Platform
Different!
Platform
Same Language Different Language
Same!
Platform
Different!
Platform
Switching languages
Switching platforms
How do I write an app in Java/Ruby/Swift?
How do I make it great?
Switching languages
Switching platforms
How do I write an app in Java/Ruby/Swift?
How do I make it great?
Takes a few week...
Programming
Platform
Language
By approximation
Inside a Developer
- Strict!
- Modern!
- Clean
Swift Features
Strict & Modern
Imagine a future Photoshop where you can never
give something a color, without defining a swatch
first. In t...
let names = ["Steve", "Tim"]	
for name in names {	
println("Hello (name)")	
}
NSArray *names = @[@"Steve", @"Tim"];

for (...
UIView.animateWithDuration(0.5) {	
	 view.alpha = 0	
}
[UIView animateWithDuration:0.5 animations:^{	
view.alpha = 0;	
}];...
Swift Features
- Strict!
- Modern!
- Clean
Swift Features
!= Easy
- Strict!
- Modern!
- Clean
Swift Features
!= Easy
Fresh
- Strict!
- Modern!
- Clean
We can start writing apps in Swift today
We can ship them when iOS 8 comes out
(Swift runs on iOS 7 and above)
We can use Swift in existing apps,
side by side with Objective-C
We should wait a little bit
(it’s buggy)
We should play with it and let
Apple know what we think
We can help shape Swift 1.0
BonusTopic
Xcode Playgrounds
Demo
(Screenshot from demo)
(Screenshot from demo)
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
Introducing Swift to the Touchwonders Team
Upcoming SlideShare
Loading in …5
×

Introducing Swift to the Touchwonders Team

629 views

Published on

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.

Published in: Software, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
629
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Introducing Swift to the Touchwonders Team

  1. 1. Swift June, 2014 Thomas Visser
  2. 2. http://giphy.com/gifs/apple-WB8mx9xfVN9AY
  3. 3. A Brief History of Programming Languages C 1972 1983 Objective-C C++ 1995 2009 Go 2003 Scala 2000 C# Java Ruby
  4. 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. 5. A Brief History of Programming Languages C 1972 1983 Objective-C C++ Java Ruby 2009 Go 2003 Scala 2000 C# Swift 20141995
  6. 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. 7. - Generics! - Closures! - Type inference! - Multiple return types! - Namespaces! - Mutability syntax Swift Features
  8. 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
  9. 9. We create great apps
  10. 10. Xcode Objective-C iOS App
  11. 11. Xcode
  12. 12. Xcode + toolchain
  13. 13. Objective-C
  14. 14. iOS Animations Data Storage Receiving/Sending notifications Location Services Media Player Address Book Access Calendar Access Achievements and Leaderboards Interface (> 4.000 new API’s in iOS 8)
  15. 15. App
  16. 16. Xcode Objective-C iOS App / Swift
  17. 17. Xcode Objective-C iOS App / Swift AppCode Highstreet, Weeronline HD, etc.
  18. 18. It’s a big deal We don’t usually switch languages
  19. 19. A photographer gets a brand new camera
  20. 20. A designer switches from Photoshop to a different program
  21. 21. A cyclist switches to new gear shifting mechanics
  22. 22. Learn the new thing Apply your trade
  23. 23. The new tool for building great apps better
  24. 24. Greatness of apps Quality of Objective-C code Quality of Swift code By approximation
  25. 25. Same Language Different Language Same! Platform Different! Platform
  26. 26. Same Language Different Language Same! Platform Different! Platform
  27. 27. Switching languages Switching platforms How do I write an app in Java/Ruby/Swift? How do I make it great?
  28. 28. Switching languages Switching platforms How do I write an app in Java/Ruby/Swift? How do I make it great? Takes a few weeks Takes months-years
  29. 29. Programming Platform Language By approximation Inside a Developer
  30. 30. - Strict! - Modern! - Clean Swift Features
  31. 31. 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.
  32. 32. 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
  33. 33. UIView.animateWithDuration(0.5) { view.alpha = 0 } [UIView animateWithDuration:0.5 animations:^{ view.alpha = 0; }]; Objective-C Swift Clean
  34. 34. Swift Features - Strict! - Modern! - Clean
  35. 35. Swift Features != Easy - Strict! - Modern! - Clean
  36. 36. Swift Features != Easy Fresh - Strict! - Modern! - Clean
  37. 37. We can start writing apps in Swift today
  38. 38. We can ship them when iOS 8 comes out
  39. 39. (Swift runs on iOS 7 and above)
  40. 40. We can use Swift in existing apps, side by side with Objective-C
  41. 41. We should wait a little bit (it’s buggy)
  42. 42. We should play with it and let Apple know what we think
  43. 43. We can help shape Swift 1.0
  44. 44. BonusTopic Xcode Playgrounds
  45. 45. Demo
  46. 46. (Screenshot from demo)
  47. 47. (Screenshot from demo)

×