Hey,
This question relates to using touch methods in a UIScrollView. I am aware of numerous ways to interact with standard UIViews (touchesBegan, touchesMoved, etc), however, these do not work in a UIScrollView.
I have tried several methods to get around this but am getting no joy:
Using gestureRecognizers - great, but do not allow for touches to be tracked (like touchesMoved).
Using a UISubView - Just can't seem to get this working, I would love some insight here. There's a lot of attempts online, but I can't find a decent tutorial.
Here is my current code for the second method:
self.myScrollView.contentSize = CGSizeMake(3072, 2304);
UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 3072, 2304)];
myImageView.image = [UIImage imageNamed:@"dot.jpg"];
[self.myScrollView addSubview: myImageView];
CGRect frame = CGRectMake(0, 0, 3072, 2304);
touchView = [[UIScrollView alloc] initWithFrame:frame];
[self.myScrollView addSubview: touchView];
for (UIGestureRecognizer *gestureRecognizer in myScrollView.gestureRecognizers)
{
if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]])
{
UIPanGestureRecognizer *panGR = (UIPanGestureRecognizer *) gestureRecognizer;
panGR.minimumNumberOfTouches = 2;
}
}
Any insight or help would be great!