Oh, I know perfectly what she meant, and so did the audience. And we all applauded because this has always been so hard to achieve in the past and we thought it was true that now it would be easy.
Your objection is spot on. Using her code from 2010, I always do what she's describing like this:
class MyScrollView : UIScrollView {
override func layoutSubviews() {
var which : Int {return 1}
switch which {
case 1:
print("layout")
super.layoutSubviews()
if let v = self.delegate?.viewForZooming?(in:self) {
let svw = self.bounds.width
let svh = self.bounds.height
let vw = v.frame.width
let vh = v.frame.height
var f = v.frame
if vw < svw {
f.origin.x = (svw - vw) / 2.0
} else {
f.origin.x = 0
}
if vh < svh {
f.origin.y = (svh - vh) / 2.0
} else {
f.origin.y = 0
}
v.frame = f
}
default:break
}
}
}
Well, as you rightly say, that code only takes over when we zoom out so far that the content view is smaller than the scroll view. It's hard to see how one constraint configuration is going to do _that_, unless it involves inequalities that she never mentioned.
But in any case, in my experiments, the content view doesn't stay centered at all. It's weird, because logging shows that the content layout guide is staying the same size, so you would think its center would not move.