title: Move Multiple images in iOS
body: <p>I have multiple images in a view controller. I am trying to implement the touch method to drag the images.  When I try to drag a single image view all the image views are dragging. Here is the code I am using:</p>
  
  <pre><code>@IBOutlet weak var img1: UIImageView!
  @IBOutlet weak var img2: UIImageView!
  @IBOutlet weak var img3: UIImageView!
  @IBOutlet weak var img4: UIImageView!
  
  var location = CGPoint(x: 0 , y:0)
  
  override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
      if let touch = touches.first{
          location = touch.locationInView(self.view)
  
          if touch.view == img1 {
              print("img1 tapped")
              img1.center = location
          }
          else if touch.view == img2 {
              print("img2 tapped")
              img2.center = location
          }
          else if touch.view == img3 {
              print("img3 tapped")
              img3.center = location
          }
      }
  
      super.touchesBegan(touches, withEvent: event)
  }
  
  override func touchesMoved(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
      if let touch = touches.first{
          location = touch.locationInView(self.view)
  
          if touch.view == img1 {
              print("img1 tapped")
              img1.center = location
          }
          else if touch.view == img2 {
              print("img2 tapped")
              img2.center = location
          }
          else if touch.view == img3 {
              print("img3 tapped")
              img3.center = location
          }
      }
  }
  </code></pre>