|
7 | 7 |
|
8 | 8 | # Change Log
|
9 | 9 |
|
| 10 | +## [1.5.0](https://github.com/mirego/PinLayout/releases/tag/1.5.0) |
| 11 | +### New method `sizeToFit(:FitType)` & `fitSize()` is now deprecated |
| 12 | + |
| 13 | +Changes: |
| 14 | + |
| 15 | +* BREAKING CHANGE: **`fitSize()`** is now deprecated. The new `sizeToFit(:FitType)` should be used instead. |
| 16 | + |
| 17 | +* New method **`sizeToFit(_ fitType: FitType)`** |
| 18 | + * **`sizeToFit(_ fitType: FitType)`** |
| 19 | + The method adjust the view's size based on the view's `sizeThatFits()` method result. |
| 20 | + PinLayout will adjust either the view's width or height based on the `fitType` parameter value. |
| 21 | + |
| 22 | + Notes: |
| 23 | + * If margin rules apply, margins will be applied when determining the reference dimension (width/height). |
| 24 | + * The resulting size will always respect `minWidth` / `maxWidth` / `minHeight` / `maxHeight`. |
| 25 | + |
| 26 | + **Parameter `fitType`:** Identify the reference dimension (width / height) that will be used to adjust the view's size. |
| 27 | + |
| 28 | + * **`.width`**: The method adjust the view's size based on the **reference width**. |
| 29 | + * If properties related to the width have been pinned (e.g: width, left & right, margins, ...), the **reference width will be determined by these properties**, if not the **current view's width** will be used. |
| 30 | + * The resulting width will always **match the reference width**. |
| 31 | + |
| 32 | + * **`.height`**: The method adjust the view's size based on the **reference height**. |
| 33 | + * If properties related to the height have been pinned (e.g: height, top & bottom, margins, ...), the **reference height will be determined by these properties**, if not the **current view's height** will be used. |
| 34 | + * The resulting height will always **match the reference height**. |
| 35 | + |
| 36 | + * **`.widthFlexible`**: Similar to `.width`, except that PinLayout won't constrain the resulting width to match the reference width. The resulting width may be smaller of bigger depending on the view's sizeThatFits(..) method result. For example a single line UILabel may returns a smaller width if its string is smaller than the reference width. |
| 37 | + |
| 38 | + * **`.heightFlexible`**: Similar to `.height`, except that PinLayout won't constrain the resulting height to match the reference height. The resulting height may be smaller of bigger depending on the view's sizeThatFits(..) method result. |
| 39 | + |
10 | 40 | ## [1.4.3](https://github.com/mirego/PinLayout/releases/tag/1.4.1)
|
11 | 41 | Fix Carthage support
|
12 | 42 |
|
|
0 commit comments