-By calling `autoSizeThatFits` with the given available size and a layout closure, any layouting performed by PinLayout in that closure will be computed without affecting any subview's `frame` in the view hierarchy. On the other hand, any non PinLayout related code will also be executed, for that reason, it is really important to isolate your layout code in a separate function to avoid any side effect from occuring during sizing, like setting the scroll view's content size in the above exemple or assigning `itemSize` in collection view layout for exemple. That kind of code that depends on the layout should only be executed when `layoutSubviews()` is called as part of a normal layout pass.
0 commit comments