I have overridden the drawRect:
in my UIView
and I want to draw several tiles. I'm looping through them all and I have a separate function that draws each individual tile.
The way I'm doing it now is I pass the tile's calculated CGRect
to the function. At the moment, any drawing methods have to include the x & y offsets of the rect passed to it when drawing the tile images.
How can I push a new offset CGContext on the stack before calling the tile draw methods?
So for example, I could draw a square at [0, 0, 50, 50]
inside the tile drawing method and that will actually be drawn at the correct tile's location?