Storyboards vs XIBs vs Code

Download Storyboards vs XIBs vs Code

Post on 23-Aug-2014

2.377 views

Category:

Software

12 download

DESCRIPTION

We've compared different methods of creating a layout on an iOS project. Presented at the NS Istanbul Meetup on June 1st, 2014. Created with Deckset. http://www.decksetapp.com You can access all the content and Deckset-ready Markdown file at: https://dl.dropboxusercontent.com/u/1497273/storyboards-nsistanbul.zip

TRANSCRIPT

  • Storyboardsvs. Interface Buildervs. Code
  • DifferentMethods
  • StoryboardsHas morethan oneviewand managestransitions
  • Supported byApple
  • Interface Builder
  • Interface Builder Circa1993
  • Code
  • Storyboards
  • Oneapplication, one storyboard
  • Oneapplication, 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?
  • BREAK INTO PIECES:WHY?
  • CONFLICT
  • WHENTO USE ADVANTAGES Easier Transitions
  • WHENTO USE ADVANTAGES Easier Transitions No alloc] init]
  • WHENTO USE ADVANTAGES Easier Transitions No alloc] init] Visual Tool
  • WHENTO USE ADVANTAGES Easier Transitions No alloc] init] Visual Tool Static Table Views
  • WHENTO USE ADVANTAGES Easier Transitions No alloc] init] Visual Tool Static Table Views More than one Cell Templates
  • WHENTO USE ADVANTAGES Easier Transitions No alloc] init] Visual Tool Static Table Views More than one Cell Templates Less le count
  • WHEN NOTTO 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 storyboardsthen.
  • Storyboard Cons - REUSABILITY
  • Storyboard Cons - DATAFLOW
  • Storyboard Cons - DATAFLOW prepareForSegue:
  • Storyboard Cons - CONFLICT
  • Interface Builder
  • Interface Builder Old.
  • Interface Builder Old. ButNSString is oldtoo.
  • Interface Builder MultipleFilesforSingleviewsorSingleFilesforMultiple relatedviews
  • Interface Builder EveryviewhasitsownXIBle.
  • Interface Builder EveryviewhasitsownXIBle. After all, that's what Object-Oriented programming stands for. -- Some programmer dude
  • WHENTO USE Modal Views
  • WHENTO USE Modal Views Login/Register screens
  • WHENTO USE Modal Views Login/Register screens Reusable Views (templates, table cells)
  • WHENTO USE Modal Views Login/Register screens Reusable Views (templates, table cells) Everywhere basically
  • Interface Builder Pros + Reusability Prepare once, use everywhere
  • Interface Builder Pros + VisualTool 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 - DonkeyCorpseamountofCode
  • Code Cons - SeeingResultsAin'tEasy Iterate/Run/Debug/Iterate Cycle
  • Code Cons - NotImminent 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];
  • ThewayIwork
  • THANKS @seyfoyun - @wearethreadco