나는 velocityInView를 반환하기 위해 UIPanGesture를 사용하고 있으며 수집 한 것부터 초당 포인트를 반환한다고 가정합니다. 내가 얻는 것은 수억의 숫자와 많은 0입니다 ... 나는 시뮬레이터에서 마우스를 빠르게 움직이지 않을 것입니다.iOS - UIPanGesture에서 velocityInView 만들기
내 생각에 ...
미리 도움 주시면 감사하겠습니다.
편집 : 요청 된 코드. 코드없이
-(void)handlePanGesture:(UIPanGestureRecognizer *) recognizer
{
if (recognizer.state == UIGestureRecognizerStateChanged ||
recognizer.state == UIGestureRecognizerStateBegan)
{
CGPoint vel = [recognizer velocityInView:myScrollView];
//[self doSpinAnimationWithVelocity:vel.x];
NSLog([NSString stringWithFormat:@"Velocity - X-Axis - %d ", vel.x]);
NSLog([NSString stringWithFormat:@"Velocity - Y-Axis - %d ", vel.y]);
}
}
Image here of output since I'm still below 10 rep
차이가 나는 경우에만 x 축을 캡처하고 있습니다. – Mytheral
y 축은 유사한 정보를 제공합니다. – Mytheral
velocityInView를 호출하는 코드와 그 번호를 보여주는 방법을 보여줍니다. – Anna