UIView があり、ドラッグして垂直方向にのみ移動したい。
私はこのコードを使用しました:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
AddView.frame = CGRectMake(AddView.frame.origin.x, location.y, AddView.frame.size.width, AddView.frame.size.height);
}
これを行うと、ビューが非常に速く上下します。
私は何を間違っていますか?