title: UIView Animation - strange behaviour (Swift)
body: <p>I have a UIImageView that contains an animated picture (sequence of pictures) i'm trying to move the UIImageView from its current position to the right of the screen (from middle to right of the screen) to create a running effect of the character </p>
  
  <p>when i press the button that i want to trigger the animation the image suddenly disappear then get animated from the left side off the screen to the middle. I have no idea why the UIImageView is being moved off the screen (left side)</p>
  
  <p>this is my code </p>
  
  <pre><code>@IBAction func correctButtonPressed(sender: AnyObject) {
          if isTrue {
              winAudio.play()
              playRunAnimation()
              UIView.animateWithDuration(3, animations: { () -&gt; Void in
                  var frame = self.animatedImage.frame
                  frame.origin.x += (self.animatedImage.superview?.frame.width)!
                  self.animatedImage.frame = frame
              })
          }
      }
  </code></pre>
  
  <p>EDIT : </p>
  
  <p>this is how i animate my UIImageView</p>
  
  <pre><code>func playIdelAnimation() {
          self.image = UIImage(named: "Idel1.png")
          var imageArray = [UIImage]()
          for i in 1...10 {
              let str = "Idle\(i).png"
              let imageName = UIImage(named: str)!
              imageArray.append(imageName)
          }
          self.animationImages = imageArray
          self.animationDuration = 0.5
          self.startAnimating()
      }
  </code></pre>
  
  <p>self.image = UIImage(named: "Idel1.png")
  is to set a default picture for the UIImageView
  then im creating an array of UIImage to animate it in the UIImageView</p>
  
  <p>using (self) because i have a custom class for the UIImageView</p>