My UIScrollView won't scroll down. I don't know why. I already followed Apple documentation regarding to this issue.
@IBOutlet weak var scroller: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func viewDidLayoutSubviews() {
scroller.scrollEnabled = true
// Do any additional setup after loading the view
scroller.contentSize = CGSizeMake(400, 2300)
}
You need to set the frame
of your UIScrollView
so that it is less than the contentsize
. Otherwise, it won't scroll.
Also, I would recommend that you add scroller.contentSize = CGSizeMake(400, 2300)
to your viewDidLoad
method.