Searched a lot for this one, but couldn\'t find a proper solution yet.
Is it possible to disable the bounce effect of a UIPageViewController
and still
In case you wish to disable scrollview on a UIPageViewController
subclass entirely, you can use the snippet below. Note that this disables not only the bouncing but the horizontal scrolling of the pages as well.
In my case I had a UISegmentedControl to switch between the pages in the PageViewController so disabling scrolling vertically was completely fine and working for me. Hope it helps someone else too.
class MyPageViewController: UIPageViewController {
private lazy var scrollView: UIScrollView = { view.subviews.compactMap({ $0 as? UIScrollView }).first! }()
override func viewDidLoad() {
super.viewDidLoad()
scrollView.isScrollEnabled = false
}
}