I’m trying to draw in a scrollview on top of an image using multi-touch. The circles are actually drawn, but under the image. In my code I currently create a custom ScrollView:
@interface AppScrollView : UIScrollView {
//objects to draw circles
NSMutableDictionary *circlesInProcess;
NSMutableArray *completeCircles;
}
@end
In my AppScrollView.m I override touches commands to store touches and add a
(void)drawRect:(CGRect) rect
method to draw the circles in the scrollview. I also include
[self setNeedsDisplay]
to display the circles. In my app controller, I declare the new custom scrollView object:
IBOutlet AppScrollView *scrollView;
Later I add an image to the scrollView using:
[scrollView addSubview:myImage];
The image is visible, but when I try to draw circles on top of it, they are drawn under the image. Let me know if you have any suggestions?
Suggestion: draw the image onto your scrollview (instead of adding the image view as a subview) and then draw the circles on top of that.