(Don\'t mark this question as duplicated. I read a lot of questions but I don\'t find the answer to my issue.)
My issue is the following: I have a UIScrollView
very charm solution is:
// also don't forget
// YourViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
self.scrollView.delegate = self
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 0 || scrollView.contentOffset.y < 0 {
scrollView.contentOffset.y = 0
}
}