I want horizontal scrollview with image view but image is not fitting with the scroll. i am doing this code but not getting the right thing 
Here is my code

```
@IBOutlet weak var upperScroll: UIScrollView!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationController?.navigationBar.isHidden = true
        // Do any additional setup after loading the view.
        var logoImage: [UIImage] = [
            UIImage(named: "slider.png")!,
            UIImage(named: "slider.png")!,
            UIImage(named: "slider.png")!,
            UIImage(named: "slider.png")!,
        ]

        upperScroll.isScrollEnabled = true
        let scrollWidth: Int = Int(self.view.frame.width)
        upperScroll.contentSize = CGSize(width: CGFloat(scrollWidth), height:(self.upperScroll.frame.height))
        upperScroll.frame = CGRect(x: 0, y: 51, width: upperScroll.frame.size.width, height: self.upperScroll.frame.height)
        upperScroll.backgroundColor = UIColor.red
        var xOffset: Int = 0
        for index in 0..<logoImage.count {
            let img = UIImageView(frame: CGRect(x: CGFloat(xOffset), y: 0, width: upperScroll.frame.size.width, height: self.upperScroll.frame.height))
            img.image = logoImage[index]
            upperScroll.addSubview(img)
            xOffset += 100
        }
        view.addSubview(upperScroll)
        upperScroll.contentSize = CGSize(width: CGFloat((scrollWidth + xOffset)), height: 110)

    }

```

[![i am getting this](https://i.stack.imgur.com/wCaiu.png)](https://i.stack.imgur.com/wCaiu.png) but i want this [![type ](https://i.stack.imgur.com/37kDd.png)](https://i.stack.imgur.com/37kDd.png)

Can anyone please help me? Thanks