Drag and "accelerate" UIImageView with UITouch
I have a UIImageView that I try to accelerate based on the distance it has been dragged and how fast it was dragged. By accelerating I mean that when touchesEnded: is called, the imageView should slide further in the direction it was dragged. How far and how fast it should slide depends on the distance and the speed with which it was dragged.
At this point I am able to drag the imageview around and get the distance it was dragged + how long time it took. Based on this I can calculate the speed and a direction vector.
But I am struggling with the slide performed on the imageview by touchesEnded:.
My questions is: Is there any common or smart way to perform this "sliding" effect on the UIImageView that I am trying do to? Or do you have any idea how I can achieve this effect?
|