Disable UIScrollView scrolling when UITextField becomes first responder

Building on Moshe’s answer… Subclass UIScrollView and override the following method:

- (void)scrollRectToVisible:(CGRect)rect animated:(BOOL)animated

Leave it empty. Job done!


In Swift:

class CustomScrollView: UIScrollView {
    override func scrollRectToVisible(_ rect: CGRect, animated: Bool) { }
}

Leave a Comment