title: Scrollview not scrolling in right
body: <p>I have a scroll vie and i want to display the images selected by user in horizontal scroll manner. The following is my code. but, I am unable to achieve that. please guide me.</p>
  
  <pre><code>var xPosition: CGFloat = 0
  var scrollViewContentWidth: CGFloat = 398
  
  func handlePickedImage(image: UIImage){
      let imageView = UIImageView(image: image)
      imageView.frame = CGRect(x: 0, y: 0, width: 398, height: 188)
      imageView.contentMode = UIView.ContentMode.scaleAspectFit
      imageView.frame.origin.x = xPosition
      imageView.frame.origin.y = 10
  
  
      let spacer: CGFloat = 10
      xPosition = 398 + spacer
      scrollViewContentWidth = scrollViewContentWidth + spacer
      imageScrollView.contentSize = CGSize(width: scrollViewContentWidth, height: 188)
      imageScrollView.addSubview(imageView)
  }
  </code></pre>