title: Making Image Slider with UIScrollView in Swift
body: <p>I am making an app that the user can upload 1 to 3 photos.
  I want the user to be able to see them it as a slider in with Page Control,
  I started to code it but for some reason the images do not added to the scrollView (I see nothing when running the app).</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>    class dogProfileViewController: UIViewController {
      var imagesArray = [UIImageView()]
      @IBOutlet var scrollView: UIScrollView!
      override func viewDidLoad() {
          super.viewDidLoad()
  
          let image1: UIImageView = UIImageView(image: UIImage(named: "image1.png"))
          let image2: UIImageView = UIImageView(image: UIImage(named: "image2.png"))
          imagesArray.append(image1)
          imagesArray.append(image2)
          var countIndex = CGFloat(0)
          for image in imagesArray {
              image.frame = CGRectMake(countIndex*view.frame.width, 0, view.frame.width, 100)
              scrollView.addSubview(image)
              countIndex = countIndex + 1
          }
  
          // Do any additional setup after loading the view.
      }
  }
  </code></pre>