Page 1
Storyboards vs. Interface Builder vs. Code
Page 3
StoryboardsHas more than one view and manages transitions
Page 4
Supported by Apple
Page 6
Interface BuilderCirca 1993
Page 9
One application, one storyboard
Page 10
One application, one storyboard
Page 13
BREAK INTO PIECES» Authentication / Registration
Page 14
BREAK INTO PIECES» Authentication / Registration
» Multi-step Order Forms
Page 15
BREAK INTO PIECES» Authentication / Registration
» Multi-step Order Forms
» Wizards, Tutorials, etc.
Page 16
BREAK INTO PIECES» Authentication / Registration
» Multi-step Order Forms
» Wizards, Tutorials, etc.
» Master-Detail
Page 17
BREAK INTO PIECES: WHY?<viewControllerLayoutGuide type="top" id="cIm-e0-J51"/><viewControllerLayoutGuide type="bottom" id="a0L-h9-sNL"/>
Page 18
BREAK INTO PIECES: WHY?
Page 20
WHEN TO USEADVANTAGES
» Easier Transitions
Page 21
WHEN TO USEADVANTAGES
» Easier Transitions
» No alloc] init]
Page 22
WHEN TO USEADVANTAGES
» Easier Transitions
» No alloc] init]
» Visual Tool
Page 23
WHEN TO USEADVANTAGES
» Easier Transitions
» No alloc] init]
» Visual Tool
» Static Table Views
Page 24
WHEN TO USEADVANTAGES
» Easier Transitions
» No alloc] init]
» Visual Tool
» Static Table Views
» More than one Cell Templates
Page 25
WHEN TO USEADVANTAGES
» Easier Transitions
» No alloc] init]
» Visual Tool
» Static Table Views
» More than one Cell Templates
» Less file count
Page 26
WHEN NOT TO USE» Complex custom UI
» UI with too many clear backgrounds
» Already implemented with code or XIBs
Page 27
Storyboard Pros +
Page 28
Storyboard Pros +
PERFORMANCE» Only the initial view is allocated
Page 29
Storyboard Pros +
PROTOTYPING» Can be used to quickly create prototypes
Page 30
Storyboard Pros +
VISUAL» For those who are better with visuals
Page 31
Storyboard Pros +
AUTO-LAYOUT» We'll come back to this
Page 32
I should use storyboards then.
Page 33
Storyboard Cons -REUSABILITY
Page 34
Storyboard Cons -DATA FLOW
Page 35
Storyboard Cons -
DATA FLOW» prepareForSegue:
Page 36
Storyboard Cons -CONFLICT
Page 37
Interface Builder
Page 38
Interface BuilderOld.
Page 39
Interface BuilderOld. But NSString is old too.
Page 40
Interface BuilderMultiple Files for Single views or Single Files for Multiple related views
Page 41
Interface BuilderEvery view has its own XIB file.
Page 42
Interface BuilderEvery view has its own XIB file.
“After all, that's what Object-Oriented programming stands for.”
-- Some programmer dude
Page 43
WHEN TO USE» Modal Views
Page 44
WHEN TO USE» Modal Views
» Login/Register screens
Page 45
WHEN TO USE» Modal Views
» Login/Register screens
» Reusable Views (templates, table cells)
Page 46
WHEN TO USE» Modal Views
» Login/Register screens
» Reusable Views (templates, table cells)
» Everywhere basically
Page 47
Interface Builder Pros +
Reusability» Prepare once, use everywhere
Page 48
Interface Builder Pros +
Visual Tool» See what you are making
Page 49
Interface Builder Pros +Auto-Layout
Page 50
Interface Builder Cons -
Localization» It's not easy for the unexperienced
Page 52
Code» When IB and Storyboards aren't enough
Page 53
Code» Understanding what's under the hood.
Page 54
Code» Use coding only for a project at least once.
Page 55
Code Pros +Performance
Page 56
Code Pros +
Reusability» Good for small changes on similar views
» Open Source
Page 57
Code Cons -Donkey Corpse amount of Code
Page 58
Code Cons -
Seeing Results Ain't Easy» Iterate/Run/Debug/Iterate Cycle
Page 59
Code Cons -
Not Imminent» Changes to the layout can't be applied that fast.
Page 60
Code Cons -
Anti-Prototyping» Say farewell to your loved ones if you are trying
this.
Page 61
Code Cons -
Auto-Layout[NSLayoutConstraint constraintWithItem:self.button1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.button2 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-12.0];
Page 63
THANKS@seyfoyun - @wearethreadco