I have a UIView that I want the user to be able to navigate around the screen.
-(void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { CGPoint pt = [[touches anyObject] locationInView:self]; CGPoint center = self.center; CGFloat adjustmentX = pt.x - startLocation.x; CGFloat adjustmentY = pt.y - startLocation.y; center.x += adjustmentX; center.y += adjustmentY; [self setCenter:center]; }
works fine until I applied the transform to the view as follows:
self.transform = CGAffineTransformMakeRotation(....);
However, once the transformation has been applied, drag the results of the UIView into the view moved by the exponential spiral effect.
I assume that I need to make a correction for rotation in the touchhesMoved method, but so far all attempts have not eluded me.
source share