I have a UIView
which is attached to a UICollisionBehavior
. I'm trying to animate its center when a new location is tapped on the screen, but it appears using this block of code is not the way to do it:
[UIView animateWithDuration:0.7f
delay:0.0f
options:UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
animations:^{
[self.mainCharacter setCenter:location];
}
completion:nil];
Can anyone suggest a more UIKitDynamics friendly way of doing this?
Thanks.
UPDATE
So the first part of my question was similar to the one posted and a possible duplicate, however, although technically it solved the issue in the first part of this question, it does seem to interfere with how collision testing in UICollisionBehavior
.
The second part of this question was to ask if there was a better way of doing this. I assumed it would be possible to accelerate a UIDynamicItem
at a speed over a given time using UIPushBehavior
but it seems to be constant.
Can anyone recommend how to use a UIPushBehavior
to do the above?