try using animation
[UIView animateWithDuration:0.5
animations:^
{
//move right
imageViewTwo.center = CGPointMake(imageViewTwo.center.x +2, imageViewTwo.center.y +2);
}
completion:^(BOOL completed)
{
if (completed)
{
//completed move right..now move left
[UIView animateWithDuration:0.5
animations:^
{
imageViewTwo.center = CGPointMake(imageViewTwo.center.x -2, imageViewTwo.center.y -2);
}];
}
}];