🚀 Released on 2021-05-18
🆕 New Objective-C interface
Instead of using verbose Objective-C with all brackets (
[[[[[[logo.pinObjc top] left] width:100] aspectRatio] marginWithTop:topLayoutGuide + 10 horizontal:10 bottom:10] layout];
It now use a function chaining:
v1.9.2July 03, 2020
v1.9.1July 03, 2020
➕ Add Automatic Sizing feature
autoSizeThatFitswith the given available size and a layout closure, any layouting performed by PinLayout in that closure will be computed without affecting any subview's
framein 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
itemSizein 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.
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.
See https://github.com/layoutBox/PinLayout#automatic_sizing for more documentation.
* Added by Antoine Lamy in Pull Request #216
- ✂ Removed swift_version from the podspec. PinLayout supports all recent Swift versions, don't need to specify them individually.