Since iOS 17.4 this is a one-liner. Content offsets or insets are not needed for centering.
scrollView.contentAlignmentPoint = CGPoint(x: 0.5, y: 0.5)
See https://stackoverflow.com/a/79482632/1046740