Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS for Web Developers

iOS for Web Developers

A presentation comparing and contrasting front-end web development with front-end iOS development.

Kevin Smith

June 26, 2012
Tweet

Other Decks in Programming

Transcript

  1. Who's a web dev? 2 Tuesday, June 26, 12 I’ve

    been doing web development way longer than native development. I still consider myself a web developer, even though I’m doing mostly native apps right now.
  2. UI Creation 8 Tuesday, June 26, 12 used to be

    about web pages. more and more: app development.
  3. 29 HTML, CSS, JS Declarative Programmatic Style Layout Behavior Animation

    Typography Yes No Yes No Yes Yes Yes Yes Yes No Tuesday, June 26, 12 So we can see that traditional front-end web development is heavy on the declarative side
  4. 31 Canvas Tuesday, June 26, 12 How many people have

    done stuff with canvas element?
  5. 33 Canvas Declarative Programmatic Style Layout Behavior Animation Typography No

    Yes No Yes No Yes No Yes No Yes Tuesday, June 26, 12 http://code.google.com/p/jqcanvas/ http://js-fireworks.appspot.com/ http://www.html5rocks.com/en/tutorials/canvas/texteffects/ http://desandro.com/articles/prototyping-with-the-canvas-element/
  6. 38 Core Graphics Tuesday, June 26, 12 Core graphics is

    the base drawing layer for iOS and OS X. Also referred to as Quartz. It’s awesome.
  7. All about drawing. 39 Put your programming hat on. Tuesday,

    June 26, 12 At the core. Higher level objects available. Still use images for things you don’t want to draw. If you get that iOS is very much like using canvas for everything, you’re grokking!
  8. UIView & CALayer Core Graphics Objective-C 41 Tuesday, June 26,

    12 UIKit encompasses the higher level objects that all sit on top of Core Graphics. Objective-C is the language that ties it all together.
  9. UIView Rectangular area on the screen Interface for managing content

    and events Many standard subclasses: buttons, labels, etc. Tuesday, June 26, 12
  10. CALayer Provide content for display Heart of animation Every UIView

    instance has one Awesome Tuesday, June 26, 12
  11. Declarative 46 Tuesday, June 26, 12 Done through a limited

    set of object properties and interface builder.
  12. 51 iOS Declarative* Programmatic Style Layout Behavior Animation Typography Yes

    Yes Yes Yes No Yes Yes Yes Yes Yes *much more limited than web Tuesday, June 26, 12
  13. Layout 53 Tuesday, June 26, 12 CSS: float, percentage size

    and position, margin, padding, position (absolute, relative) iOS: few declarative items: frame = origin + size. always position relative.
  14. CSS Float Margin Padding Absolute and relative positioning Tuesday, June

    26, 12 Also: HTML elements have a natural positioning or flow depending on where they are placed in the DOM.
  15. iOS Tuesday, June 26, 12 x, y, width, height (x,y)

    coordinates specify absolute position relative to the containing view
  16. Style 61 Tuesday, June 26, 12 CSS: lots of declarative

    properties iOS: some declarative properties, can be fully controlled with drawing
  17. iOS Tuesday, June 26, 12 line height is no able

    to be set with UILabel instances. Have to resort to Core Text or web view.
  18. This class does not support multiple styles for text. The

    font, color, and text alignment attributes you specify always apply to the entire contents of the text view. To display more complex styling in your application, you need to use a UIWebView object and render your content using HTML. Tuesday, June 26, 12 UITextView class documentation: http://developer.apple.com/library/ios/ #DOCUMENTATION/UIKit/Reference/UITextView_Class/Reference/UITextView.html
  19. All about drawing. 76 You can draw your text, too.

    Tuesday, June 26, 12 using Core Text