Using CoreGraphics to render tiles