documentr

63
Storyboards vs. Interface Builder vs. Code

Upload: phuochiep123

Post on 21-May-2021

0 views

Category:

Recruiting & HR


0 download

Tags:

DESCRIPTION

e

TRANSCRIPT

Page 1: Documentr

Storyboards vs. Interface Builder vs. Code

Page 2: Documentr

Different Methods

Page 3: Documentr

StoryboardsHas more than one view and manages transitions

Page 4: Documentr

Supported by Apple

Page 5: Documentr

Interface Builder

Page 6: Documentr

Interface BuilderCirca 1993

Page 7: Documentr

Code

Page 8: Documentr

Storyboards

Page 9: Documentr

One application, one storyboard

Page 10: Documentr

One application, one storyboard

Page 11: Documentr

Storyboards

Page 12: Documentr

Storyboards

Page 13: Documentr

BREAK INTO PIECES» Authentication / Registration

Page 14: Documentr

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

Page 15: Documentr

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

Page 16: Documentr

BREAK INTO PIECES» Authentication / Registration

» Multi-step Order Forms

» Wizards, Tutorials, etc.

» Master-Detail

Page 17: Documentr

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

Page 18: Documentr

BREAK INTO PIECES: WHY?

Page 19: Documentr

CONFLICT

Page 20: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

Page 21: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

Page 22: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

Page 23: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

Page 24: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

Page 25: Documentr

WHEN TO USEADVANTAGES

» Easier Transitions

» No alloc] init]

» Visual Tool

» Static Table Views

» More than one Cell Templates

» Less file count

Page 26: Documentr

WHEN NOT TO USE» Complex custom UI

» UI with too many clear backgrounds

» Already implemented with code or XIBs

Page 27: Documentr

Storyboard Pros +

Page 28: Documentr

Storyboard Pros +

PERFORMANCE» Only the initial view is allocated

Page 29: Documentr

Storyboard Pros +

PROTOTYPING» Can be used to quickly create prototypes

Page 30: Documentr

Storyboard Pros +

VISUAL» For those who are better with visuals

Page 31: Documentr

Storyboard Pros +

AUTO-LAYOUT» We'll come back to this

Page 32: Documentr

I should use storyboards then.

Page 33: Documentr

Storyboard Cons -REUSABILITY

Page 34: Documentr

Storyboard Cons -DATA FLOW

Page 35: Documentr

Storyboard Cons -

DATA FLOW» prepareForSegue:

Page 36: Documentr

Storyboard Cons -CONFLICT

Page 37: Documentr

Interface Builder

Page 38: Documentr

Interface BuilderOld.

Page 39: Documentr

Interface BuilderOld. But NSString is old too.

Page 40: Documentr

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

Page 41: Documentr

Interface BuilderEvery view has its own XIB file.

Page 42: Documentr

Interface BuilderEvery view has its own XIB file.

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

-- Some programmer dude

Page 43: Documentr

WHEN TO USE» Modal Views

Page 44: Documentr

WHEN TO USE» Modal Views

» Login/Register screens

Page 45: Documentr

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

Page 46: Documentr

WHEN TO USE» Modal Views

» Login/Register screens

» Reusable Views (templates, table cells)

» Everywhere basically

Page 47: Documentr

Interface Builder Pros +

Reusability» Prepare once, use everywhere

Page 48: Documentr

Interface Builder Pros +

Visual Tool» See what you are making

Page 49: Documentr

Interface Builder Pros +Auto-Layout

Page 50: Documentr

Interface Builder Cons -

Localization» It's not easy for the unexperienced

Page 51: Documentr

Code

Page 52: Documentr

Code» When IB and Storyboards aren't enough

Page 53: Documentr

Code» Understanding what's under the hood.

Page 54: Documentr

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

Page 55: Documentr

Code Pros +Performance

Page 56: Documentr

Code Pros +

Reusability» Good for small changes on similar views

» Open Source

Page 57: Documentr

Code Cons -Donkey Corpse amount of Code

Page 58: Documentr

Code Cons -

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

Page 59: Documentr

Code Cons -

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

Page 60: Documentr

Code Cons -

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

this.

Page 61: Documentr

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: Documentr

The way I work

Page 63: Documentr

THANKS@seyfoyun - @wearethreadco