Upload
martin-mitrevski
View
26
Download
0
Embed Size (px)
Citation preview
Thinking in Swift
Classes
Problems with classes
• Implicit sharing• Class inheritance is too intrusive• Lost type relationships
Protocol Oriented Programming
https://developer.apple.com/videos/play/wwdc2015/408/
Protocol Oriented Programming
• Protocols are more flexible• Structs are lightweight• Protocol extensions• Retroactive modelling
MVC
Model - View - View Model
Functional Reactive Programming
Streams
Transformations
Bindings
RXSwift
• Observable• Variable• Driver• bindTo
Objective-C libraries
Networking library
• Based on NSURLConnection• No dependency on Objective-C• Not complex requirements• To try something new
Networking
Start with a protocol
protocol HTTP { func executeRequest(request: Request) -> Result<Response, NSError>}
Demo
• Table views• Protocols• HTTP client
Finishing thoughts• More expressive• Less bugs• Better testing• Different• Fun