title: How to make an image repeat a moving cycle on Xcode?
body: <p>I have an image that starts on one end of the screen and it moves from left to right, my problem is it continuously moves to the right thus loosing the image and it just moves to the right forever. How can I make it go back and restart the movement from the left? Not moving the image back from right to left but starting the movement again from the left.</p>
  
  <p>Here is my code.
  The orientation is landscape</p>
  
  <pre><code>-(void)imageMovement {
       image.center = CGRectMake(image.center.x - 1, image.center.y);
  }
  
  -(void)viewDidLoad {
       [super viewDidLoad];
       [self imageMovement];
       imageMovementTimer = [NSTimer scheduledWithTimeInterval:0.015 target:nil selector:@selector(imageMovement)userInfo:nil repeat:YES];    
  }
  </code></pre>
  
  <p>This code moves the image, so how do I make it restart again? I've tried using if statements like</p>
  
  <pre><code>if (CGRectIntersectsRect(image.frame, block.frame)) {
      image.center = CGRectMake(image.center.x - 1, image.center.y);
  }
  </code></pre>
  
  <p>That doesn't work. Can anyone help me?</p>