With Cocoa Touch in Objective-C, I’m looking for the optimal way to draw a target image, (i.e. circles within circles, simple enough), and then have the user’s touch recorded on the image, (potentially as an x or + mark), and more importantly, in memory for later re-drawing.
I’ll be using a loupe for when the user holds their finger down for prolonged periods to enable more precise positioning, which I’ve learnt by reading and experimenting with the CoffeeShopped article and source.
Create a subclass of uiview and implement drawRect
Will draw
You should set you’re views backgoundColor to
[UIColor clearColor]to make it not black around the edges.You could also tweak this into a loop but that is the simplest example code i can show.
Note: I’ve not reused the colors, for simplicity of arc/nonarc code