sorry,I have a problem.I don't use storyBoard.

I want to make a view like this.  

[photo by terenceLuffy/AppStoreStyleHorizontalScrollView](https://camo.githubusercontent.com/981c03a8c109b8649e54a154d6478b44c9b44e89/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f39313637353332332f7468756d626f6f6b72312e676966) 

but I try to do this.
Finlly,scrollView just show last button like this.
[![enter image description here](https://i.stack.imgur.com/SxKnF.png)](https://i.stack.imgur.com/SxKnF.png) 

This is code:

```
var scView:UIScrollView = UIScrollView()
var buttonPadding:CGFloat = 10
var xOffset:CGFloat = 10

scView.backgroundColor = UIColor.blue
scView.translatesAutoresizingMaskIntoConstraints = false

func viewDidLoad() {

for i in 0 ... 10 {

    let button = UIButton()

    button.tag = i
    button.backgroundColor = UIColor.darkGray
    button.setTitle("\(i)", for: .normal)
    button.addTarget(self, action: #selector(btnTouch), for: UIControlEvents.touchUpInside)

    button.frame = CGRect(x: xOffset, y: CGFloat(buttonPadding), width: 70, height: 30)

    xOffset = xOffset + CGFloat(buttonPadding) + button.frame.size.width
    scView.addSubview(button)

}

scView.contentSize = CGSize(width: xOffset, height: scView.frame.height)

}

```

please help me.
Thanks all!