+ All Categories
Transcript

Storyboards vs. Interface Builder vs. Code

Different Methods

StoryboardsHas more than one view and manages transitions

Supported by Apple

Interface Builder

Interface BuilderCirca 1993

Code

Storyboards

One application, one storyboard

One application, one storyboard

Storyboards

Storyboards

BREAK INTO PIECES» Authentication / Registration

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

» Master-Detail

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

BREAK INTO PIECES: WHY?

CONFLICT

WHEN TO USEADVANTAGES

» Easier Transitions

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

» Less file count

WHEN NOT TO USE» Complex custom UI

» UI with too many clear backgrounds

» Already implemented with code or XIBs

Storyboard Pros +

Storyboard Pros +

PERFORMANCE» Only the initial view is allocated

Storyboard Pros +

PROTOTYPING» Can be used to quickly create prototypes

Storyboard Pros +

VISUAL» For those who are better with visuals

Storyboard Pros +

AUTO-LAYOUT» We'll come back to this

I should use storyboards then.

Storyboard Cons -REUSABILITY

Storyboard Cons -DATA FLOW

Storyboard Cons -

DATA FLOW» prepareForSegue:

Storyboard Cons -CONFLICT

Interface Builder

Interface BuilderOld.

Interface BuilderOld. But NSString is old too.

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

Interface BuilderEvery view has its own XIB file.

Interface BuilderEvery view has its own XIB file.

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

-- Some programmer dude

WHEN TO USE» Modal Views

WHEN TO USE» Modal Views

» Login/Register screens

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

» Everywhere basically

Interface Builder Pros +

Reusability» Prepare once, use everywhere

Interface Builder Pros +

Visual Tool» See what you are making

Interface Builder Pros +Auto-Layout

Interface Builder Cons -

Localization» It's not easy for the unexperienced

Code

Code» When IB and Storyboards aren't enough

Code» Understanding what's under the hood.

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

Code Pros +Performance

Code Pros +

Reusability» Good for small changes on similar views

» Open Source

Code Cons -Donkey Corpse amount of Code

Code Cons -

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

Code Cons -

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

Code Cons -

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

this.

Code Cons -

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

The way I work

THANKS@seyfoyun - @wearethreadco


Top Related