I have a UIScrollView with 10 pages. I am able to flick between them. I also want to have 2 buttons (a back button and a next button) which when touched will go to the previ
Here is a static method in swift:
static func scrollToPage(scrollView: UIScrollView, page: Int, animated: Bool) { var frame: CGRect = scrollView.frame frame.origin.x = frame.size.width * CGFloat(page); frame.origin.y = 0; scrollView.scrollRectToVisible(frame, animated: animated) }