Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBOutlet weak var scrollView: UIScrollView!
- scrollView.contentSize = CGSize(width: 500.0, height: 30.0)
- scrollView.scrollEnabled = true
- scrollView.pagingEnabled = true
- scrollView.showsVerticalScrollIndicator = false
- scrollView.showsHorizontalScrollIndicator = false
- var y = CGFloat(0.0)
- for _ in 0...20 {
- let label = UILabel(frame: CGRect(x: y, y: 0, width: 150.0, height: 30.0))
- label.text = "Lab"
- scrollView.addSubview(label)
- y += 160
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement