To drawRect or not to drawRect?
When you go searching StackOverflow for some instructions on how to do some
custom drawing on iOS, you’ll often find that the top answer instructs you to
create a custom subclass of UIView
, and override the drawRect:
method. But
is this always the best approach? What does drawRect:
actually do, and what
are the other options for custom drawing on iOS?
In March 2014 I popped over to the US on behalf of ShinobiControls and presented this as a talk at CocoaConf DC and CocoaConf Mini Austin. I’ve collected the slides and relevant links in this post for you to enjoy.
The slides are below - and are available on SpeakerDecK:
The accompanying arrow-drawing project is available on Github at github.com/sammyd/iOS-ArrowDrawing. Feel free to fork it and send me pull requests with any mistakes you find =]
I always appreciate comments/complaints hit me up on twitter - @iwantmyrealname. And since I’m in full-flow with the self-promotion, you should go and download a copy of my free eBook - iOS7: day by day.
That’s it. I’m all out
sam