Skip to content

Commit b702f19

Browse files
committed
Wording
1 parent af7633d commit b702f19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ Sizing views as part of the manual layout process is made with `sizeThatFits(_ s
15261526
}
15271527
```
15281528

1529-
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.
1529+
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 separate your layout code in it's own function to avoid any side effect during sizing, like setting the scroll view's content size in the above exemple or perhaps assigning `itemSize` in a collection view layout. That kind of code that depends on the layout should only be executed when `layoutSubviews()` is called as part of a normal layout pass.
15301530

15311531
The resulting size also takes into account the margins applied on subviews, even on the bottom and trailing sides. Automatic sizing makes it really easy to write your layout logic once and add proper sizing behavior with virtually no additional effort.
15321532

0 commit comments

Comments
 (0)