TheHellOTrofasdasd TheHellOTrofasdasd - 5 months ago 18
Objective-C Question

Add animation to uiview moving from point A to point B

I have a gesture which action moves a UIView to point B from point A. How can I add a nice transition of the UIView moving from point A to point B. I am looking at making it slowly move from point A to point B. How would I do this? At the moment to move the item I set the frame to point B.

Answer

check this code and set frame what you want

[UIView animateWithDuration:0.75 animations:^{
    button.frame = CGRectMake(10, 70, 100, 100);
}];