クリックすると左右に移動するビューがあります。ビューの中心点のみを取得します。ビューをクリックすると移動するため、アンカーポイントで uiview を取得するにはどうすればよいですか。
これが私のコードです:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touchesMoved called");
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchpoint=[touch locationInView:self.view];
if ([touch view]==secondView)
{
secondView.center=touchpoint;
[self animateFirstPoint:[touch view]];
}
}