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

Custom iOS Controls

Custom iOS Controls

I gave this presentation at MDC 2011 to demonstrate the following techniques:

- Custom rendered background image for UINavigationBar
- Custom rendered buttons for UIBarButtonItems
- Core Graphics
- Core Animation
- Loading indicator with zoom/fade effects

Sam Kirchmeier

May 07, 2012
Tweet

More Decks by Sam Kirchmeier

Other Decks in Programming

Transcript

  1. Custom iOS Controls Sam Kirchmeier [email protected] @skirchmeier Monday, May 7,

    12
  2. Monday, May 7, 12

  3. http://finalpass.com Monday, May 7, 12

  4. Monday, May 7, 12

  5. Monday, May 7, 12

  6. Monday, May 7, 12

  7. Monday, May 7, 12

  8. Topics •Customizing UINavigationBar •Customizing UIBarButtonItem •Activity Indicator View •Core Graphics

    •Core Animation •iOS 5 Features Monday, May 7, 12
  9. Linen Monday, May 7, 12

  10. Monday, May 7, 12

  11. Monday, May 7, 12

  12. Monday, May 7, 12

  13. Monday, May 7, 12

  14. Monday, May 7, 12

  15. Monday, May 7, 12

  16. [UIColor viewFlipsideBackgroundColor] Monday, May 7, 12

  17. UINavigationBar Monday, May 7, 12

  18. Options •Subclass •Category Method •Method Swizzling Monday, May 7, 12

  19. Option #4 UIAppearance CENSORED Monday, May 7, 12

  20. Monday, May 7, 12

  21. Monday, May 7, 12

  22. Subclass •UINavigationController uses UINavigationBar Monday, May 7, 12

  23. Category Method •Collisions •Broad impact Monday, May 7, 12

  24. Method Swizzling •Can’t always swizzle •Broad impact •Apple has rejected

    apps that use method_exchangeImplementations Monday, May 7, 12
  25. Subclass Monday, May 7, 12

  26. UIBarButtonItem Monday, May 7, 12

  27. Compromise •Core Graphics is limited •iOS 5 Core Image is

    limited •Make the designer do it Monday, May 7, 12
  28. Monday, May 7, 12

  29. Benefits •Mostly device & resolution independent •Stretchable without losing detail

    •Works in iOS 4 & 5 Monday, May 7, 12
  30. Ness Monday, May 7, 12

  31. Monday, May 7, 12

  32. Monday, May 7, 12

  33. Monday, May 7, 12

  34. Monday, May 7, 12

  35. iOS 5 •Lots of new UIKit features •WWDC Video: “Customizing

    the Appearance of UIKit Controls” •https://developer.apple.com/videos/wwdc/ 2011/ Monday, May 7, 12
  36. https://github.com/livefront/linen Monday, May 7, 12