how to use core graphics to draw 2d