IOS Touch, Gestures, Animation?

Why don't you consider using UIPanGestureRecognizer You can use the translationInView: to move the box as moves the finger across. And when the gesture's state is UIGestureRecognizerStateEnded you could use velocityInView: to get the desired follow up effect.

Why don't you consider using UIPanGestureRecognizer. You can use the translationInView: to move the box as moves the finger across. And when the gesture's state is UIGestureRecognizerStateEnded, you could use velocityInView: to get the desired follow up effect.

So velocityInView keeps moving my box even as I lift my finger. Gradually slowing the box to a standstill? – Srikar Jun 3 at 9:47 It gives you points per second in which the user was moving the box.

You can use some kind of decceleration rate to calculate where it will reach when it slows down and animate the box to that location over a period of time. – Deepak Jun 3 at 9:50 cool! Thanks.Do you have some sample code I could look at?

Or else I'll figure it out... – Srikar Jun 3 at 10:03 Nothing at hand for simulating the momentum. The deceleration thing will have to be a trial and error thing though. – Deepak Jun 3 at 10:18.

If (recognizer. State == UIGestureRecognizerStateEnded) { CGPoint velocityPoint = recognizer velocityInView:yourView; UIView setAnimationDelegate:self; UIView beginAnimations:nil context:nil; UIView setAnimationDuration:0.5; UIView setAnimationCurve:UIViewAnimationCurveEaseInOut; yourView setCenter:CGPointMake(yourView.center. X + (velocityPoint.

X/4), yourView.center. Y + (velocityPoint. Y/4)); recognizer setTranslation:CGPointZero inView:yourView; UIView commitAnimations; } Hope this will help someone :).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions