I have a UIButton, which when it's pressed I want to move the position of it.
I've managed to do this by this code:
ans2.frame = CGRectOffset(ans2.frame, 0, 20);
However this just moves the button instantly.
I've also tried just moving it by doing ++ to the position until the new one is reached, however this makes it look like the "animation" lags.
Would it be possible to move the button with a smooth animation?
UIKit provides several ways to perform animations. The simplest way in your case would be this:
However, there are plenty of other possibilities to animate. Checkout Apple's Animation Guide.