After investigating Custom UITableViewCell backgroundView & selectedBackgroundView, I noticed that each layer of backgroundView & selectedBackgroundView (of each cell of a grouped table view) has a CGImageRef as its contents.
Must Apple be creating each CGImageRef and explicitly setting the contents of each layer?
Yes, a
UIGroupTableViewCellBackgroundis its layer’s delegate and sets its layer’scontentsindisplayLayer:. I figured this out by creatingMyLayer : CALayerwith asetContents:method, in which I put a breakpoint, and implementing+[UIGroupTableViewCellBackground layerClass]to return[MyLayer class]. Then, I inspected the backtrace when the breakpoint was hit.