"universal programming recipes", kateryna trofimenko
TRANSCRIPT
Universal programming recipes
Kateryna Trofimenko iOS developer
What do we do?
What do we do?
Application
What do we do?
ApplicationService
What do we do?
ApplicationServicePlatform
What do we do?
ApplicationServicePlatformUser experience
What are the properties of good code?
Clean
Structured
Readable and well documented
Testable
Working
Difference engine by Charles Babbage
Patterns
Patterns
a general solution to a problem
Patterns
a general solution to a problem
a reusable architectural outline
Delegate
Delegate
Customise behaviour without subclassing
DelegateCustomise behaviour without subclassing
UIApplication UIApplicationDelegate
Data Source
Data Source
Customise data retrieval without subclassing
Data SourceCustomise data retrieval without subclassing
UITableView DataSource
Data SourceCustomise data retrieval without subclassing
UITableView DataSource
UICollectionView DataSource
Data SourceCustomise data retrieval without subclassing
UITableView DataSource
UICollectionView DataSource
UIPickerView DataSource
Data SourceCustomise data retrieval without subclassing
section count cells count
headers cells
UITableView DataSource
Target - Action
Target - Action
A consistent way to connect controls to custom logic
Target - ActionA consistent way to connect controls to custom logic
UIButton
@IBAction func buttonAction(sender: AnyObject)
button.addTarget(self, action: "buttonAction", forControlEvents: .TouchUpInside)
Target - ActionA consistent way to connect controls to custom logic
UISwitcher
switcher.addTarget(self, action: "switchAction", forControlEvents: .ValueChanged)
Target - ActionA consistent way to connect controls to custom logic
UIGestureRecognizer
gestureRecognizer.addTarget(self, action: "tapGestureAction")
Responder chain
Responder chainHandle events without knowledge of which object will be used
Responder chainHandle events without knowledge of which object will be used
useraction
Responder chainHandle events without knowledge of which object will be used
useraction UIView
Responder chainHandle events without knowledge of which object will be used
useraction UIView
UIView
Responder chainHandle events without knowledge of which object will be used
useraction UIView
UIView
UIView
UIView
Composite
Composite
Manipulate a group of objects as a single object
CompositeManipulate a group of objects as a single object
UIView
CompositeManipulate a group of objects as a single object
UIView
UIView
UIView
UIView
CompositeManipulate a group of objects as a single object
UIViewUIView
UIView
UIView
CompositeManipulate a group of objects as a single object
UIView
UIView
UIView
UIView
MVC
MVC
Model View
Controller
MVC
Model View
Controller
Updates
User actionsNotifications
More…
More…
MVP
More…
MVPMVVM
More…
MVPMVVMVIPER
Sprint #1:
Sprint #3:
Sprint #5:
Sprint #10:
Sprint #11:
Sprint #12:
Sprint #13:
Sprint #13:
Sprint #13:
Refactoring!
Information Flow
find the truth
find the truth
ask why, not how
Clear responsibilities
Profile View Controller
Input validator
Profile View Controller
Input validator
Chat View Controller
Input validator
Profile View Controller
Input validator
Chat View Controller
Input validator Tests
Mutation
Mutation
Mutation
Mutation
Mutation
Mutation
Mutation
Mutation
Simplify with immutability
Simplify with immutability
Simplify with immutability
Simplify with immutability
Simplify with immutability
Simplify with immutability
Feature flags
Feature flags
Feature flags
Feature flags
Feature flags
Feature flags
Feature flags
Core iOS Application Architectural Patterns bit.ly/wwdc2014-224
Advanced iOS Application Architecture and Patterns bit.ly/wwdc2014-229
Designing Intuitive User Experiences bit.ly/wwdc2014-211
Protocol-Oriented Programming in Swift bit.ly/wwdc2015-408
• developer.apple.com • iosdevweekly.com • ios-goodies.com • natashatherobot.com • swiftnews.curated.co • mikeash.com/pyblog • www.objc.io • nshipster.com • www.jessesquires.com • yalantis.com/blog/category/programming/ • lists.swift.org/pipermail/swift-users/ • lists.swift.org/pipermail/swift-evolution/
Veronica Ray Cathy Birdy Erica Sadun
Ayaka Nonaka Mike Ash
Ash Furrow Andy Matuschak
Chris Eidhof
Marcin Krzyzanowski Ørta
Peter Steinberger Javier Soto Nate Cook
Felix Krause Ray Wenderlich
A. Nelson-Hornstein
2007
2007 2008
2007 2008 2010
2007 2008 2010 2014
2007 2008 2010 2014
Professions that don’t exist - yet!