Group Group Group Group Group Group Group Group Group Forums

Core Graphics Tutorial: Lines, Rectangles, and Gradients

This Core Graphics tutorial series is going to take the mystery out of Core Graphics and present it step by step in a series of practical exercises, starting by beautifying a table view with Core Graphics!

This is a companion discussion topic for the original entry at

Hi,when will the method drawRect: in the customCellBackground.m be called?In the cellForRowAtIndexPath method,cell.backgroundView = [[CustomCellBackground alloc] init]; doesn’t give the frame of customCellBackground,so drawRect method can’t be called.
Where does the value come from ,when drawRect method be called?

Hi Ray,

Is it possible to create a Swift version of this nice example? Just for newbies like me, not familiar with Objective-C.



This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]