Swift version: 5.4
It's common to adjust content insets of a scroll view or any class that embeds one (table view, text view, etc) so that you control the scrolling mechanism precisely, but whenever you change the content inset it's a good idea also to change the scroll indicator inset: the visual indicator bar on the right that shows users how far they have left to scroll.
Changing this value adds a tiny bit of UI polish and it's easy to do:
scrollView.scrollIndicatorInsets = UIEdgeInsets(top: 30, left: 0, bottom: 0, right: 10)
SPONSORED Join a FREE crash course for iOS devs who want to become complete senior developers — from October 18th to 24th. Learn how to apply iOS app architecture patterns through a series of lectures and practical coding sessions.
Available from iOS 2.0
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
Link copied to your pasteboard.