I am creating some UITableViewCells with several custom items inside, my question is what route to go:
1) Add all I need as separate views to contentView, using UILabels for text and UIImageViews for images (currently using this)
or
2) Add a single subclassed View to contentView, and all my text as NSString then my Images and UIImages and draw everything at drawRect
What would perform better, and in what scenarios would one be the better choice over the other?, as I see it unless you are actually drawing lines or something in the contentView, simply going with option 1 would be easier, and according to this Cocoa with love custom cells it is more efficient although it is a bit old, so I don’t know if this has changed.
So what is better for performance and in which situation would you definitely use one over the other?
Start with the first method of using separate UILabel’s and UIImageView’s. Test on actual devices and optimize if you see performance problems.
Depending on the content I’ve had option 1 be faster than drawing everything in one view. Especially when that view had to draw images. UIImageView’s are heavily optimized by apple.
A good way to get metrics on performance is the Core Animation instrument.