For anyone who still search for this topics recently, this is the Swift 3 version to do what @Siddharthan wants:
//you may give any Int value to these variables
let Xposition = 19
let Yposition = 19
let imageWidth = 93
let imageHeight = 128
//create UIImageView object
var curr_imageView = UIImageView()
for i in 0 ..< images.count {
if imageViews.isEmpty {
curr_imageView = UIImageView.init(frame: CGRect(x: Xposition, y: Yposition, width: imageWidth, height: imageHeight))
} else {
curr_imageView = UIImageView.init(frame: CGRect(x: Int(imageViews[i-1].frame.origin.x)+Int(imageViews[i-1].frame.size.width), y: Yposition, width: imageWidth, height: imageHeight))
}
curr_imageView.image = UIImage(named: images[i])
curr_imageView.contentMode = .scaleAspectFit
self.scrollView1.addSubview(curr_imageView)
imageViews.append(curr_imageView)
}
self.scrollView1.contentSize = CGSize(width: imageViews[imageViews.count-1].frame.size.width+imageViews[imageViews.count-1].frame.origin.x+CGFloat(Xposition), height: self.scrollView1.frame.size.height)