iPhone view move animation

animation, ios, iphone, objective-c, uiview

Solution

try this code;

  UIView* view = [self.view viewWithTag:100];
  [UIView animateWithDuration:0.5
                              delay:0.1
                            options: UIViewAnimationCurveEaseOut
                         animations:^
         {                 
             CGRect frame = view.frame;
             frame.origin.y = 0;
             frame.origin.x = (-100);
             view.frame = frame;
         }
                         completion:^(BOOL finished)
         {
             NSLog(@"Completed");

         }];

Problem

I want to move one view to right when I clicked a button. I wrote something but it's not working; ``` UIView* view = [self.view viewWithTag:100]; if (!view) { NSLog(@"nil"); } [UIView animateWithDuration:0.3f animations:^{ [view setTransform:CGAffineTransformMakeTranslation(-100, 0)]; } completion:^(BOOL finished){ } ]; ```

Original source