r

63
Storyboards vs. Interface Builder vs. Code

TAGS:

description

e

Transcript of r

Page 1: r

Storyboards vs. Interface Builder vs. Code

Page 2: r

Different Methods

Page 3: r

StoryboardsHas more than one view and manages transitions

Page 4: r

Supported by Apple

Page 5: r

Interface Builder

Page 6: r

Interface BuilderCirca 1993

Page 7: r

Code

Page 8: r

Storyboards

Page 9: r

One application, one storyboard

Page 10: r

One application, one storyboard

Page 11: r

Storyboards

Page 12: r

Storyboards

Page 13: r

BREAK INTO PIECES» Authentication / Registration

Page 14: r

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

Page 15: r

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

Page 16: r

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

» Master-Detail

Page 17: r

BREAK INTO PIECES: WHY?<viewControllerLayoutGuide type="top" id="cIm-e0-J51"/><viewControllerLayoutGuide type="bottom" id="a0L-h9-sNL"/>

Page 18: r

BREAK INTO PIECES: WHY?

Page 19: r

CONFLICT

Page 20: r

WHEN TO USEADVANTAGES

» Easier Transitions

Page 21: r

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

Page 22: r

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

Page 23: r

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

Page 24: r

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

Page 25: r

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

» Less file count

Page 26: r

WHEN NOT TO USE» Complex custom UI

» UI with too many clear backgrounds

» Already implemented with code or XIBs

Page 27: r

Storyboard Pros +

Page 28: r

Storyboard Pros +

PERFORMANCE» Only the initial view is allocated

Page 29: r

Storyboard Pros +

PROTOTYPING» Can be used to quickly create prototypes

Page 30: r

Storyboard Pros +

VISUAL» For those who are better with visuals

Page 31: r

Storyboard Pros +

AUTO-LAYOUT» We'll come back to this

Page 32: r

I should use storyboards then.

Page 33: r

Storyboard Cons -REUSABILITY

Page 34: r

Storyboard Cons -DATA FLOW

Page 35: r

Storyboard Cons -

DATA FLOW» prepareForSegue:

Page 36: r

Storyboard Cons -CONFLICT

Page 37: r

Interface Builder

Page 38: r

Interface BuilderOld.

Page 39: r

Interface BuilderOld. But NSString is old too.

Page 40: r

Interface BuilderMultiple Files for Single views or Single Files for Multiple related views

Page 41: r

Interface BuilderEvery view has its own XIB file.

Page 42: r

Interface BuilderEvery view has its own XIB file.

“After all, that's what Object-Oriented programming stands for.”

-- Some programmer dude

Page 43: r

WHEN TO USE» Modal Views

Page 44: r

WHEN TO USE» Modal Views

» Login/Register screens

Page 45: r

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

Page 46: r

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

» Everywhere basically

Page 47: r

Interface Builder Pros +

Reusability» Prepare once, use everywhere

Page 48: r

Interface Builder Pros +

Visual Tool» See what you are making

Page 49: r

Interface Builder Pros +Auto-Layout

Page 50: r

Interface Builder Cons -

Localization» It's not easy for the unexperienced

Page 51: r

Code

Page 52: r

Code» When IB and Storyboards aren't enough

Page 53: r

Code» Understanding what's under the hood.

Page 54: r

Code» Use coding only for a project at least once.

Page 55: r

Code Pros +Performance

Page 56: r

Code Pros +

Reusability» Good for small changes on similar views

» Open Source

Page 57: r

Code Cons -Donkey Corpse amount of Code

Page 58: r

Code Cons -

Seeing Results Ain't Easy» Iterate/Run/Debug/Iterate Cycle

Page 59: r

Code Cons -

Not Imminent» Changes to the layout can't be applied that fast.

Page 60: r

Code Cons -

Anti-Prototyping» Say farewell to your loved ones if you are trying

this.

Page 61: r

Code Cons -

Auto-Layout[NSLayoutConstraint constraintWithItem:self.button1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.button2 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:-12.0];

Page 62: r

The way I work

Page 63: r

THANKS@seyfoyun - @wearethreadco