Releases: layoutBox/FlexLayout
Fix retain cycle
- Fix retain cycle
- Now Flex's hosting view is kept using a weak reference.
- Fixed by Alexey Zinchenko in Pull Request #64
Fix Yoga's rounding issues
Fix Yoga's rounding issues
- Integer truncation of sizes calculated by sizeThatFits:, and utility functions. Introduced by Obj-C -> Obj-C++ conversion in previous PR
- Low coordinate rounding threshold, which results in flooring apparently valid values. Layout becomes very wrong with absolute coordinate values larger than 100 and having pointScaleFactor set to 3.
- Added by Alexey Zinchenko in Pull Request #63
Update Yoga core to latest master (1.7)
Update Yoga core to latest master
- Yoga core updated to facebook/yoga@295d111 (v 1.7)
- Yoga core tests and their buck configuration added, see core-tests folder
- Add buck tests to CI config
- Added by Alexey Zinchenko in Pull Request #62
Integrates Yoga's sources into FlexLayout
That was not my first choice, but Yoga's repository is diverging from our iOS needs.
Reasons:
-
Yoga is now C++ and not C anymore. This was causing issues when built into frameworks.
-
FlexLayout Carthage support was not really great using Yoga's repository. The previous solution was already using a fork of Yoga's repo, but there was some issues while deploying app to the App store (embedding frameworks).
Add margins methods taking percentage parameters
Add margins methods taking percentage parameters:
marginTop(_ percent: FPercent)
Top margin specify the offset the top edge of the item should have from it’s closest sibling (item) or parent (container).marginLeft(_ percent: FPercent)
Left margin specify the offset the left edge of the item should have from it’s closest sibling (item) or parent (container).marginBottom(_ percent: FPercent)
Bottom margin specify the offset the bottom edge of the item should have from it’s closest sibling (item) or parent (container)marginRight(_ percent: FPercent)
Right margin specify the offset the right edge of the item should have from it’s closest sibling (item) or parent (container).marginStart(_ percent: FPercent)
Set the start margin. In LTR direction, start margin specify the left margin. In RTL direction, start margin specify the right margin.marginEnd(_ percent: FPercent)
Set the end margin. In LTR direction, end margin specify the right margin. In RTL direction, end margin specify the left margin.marginHorizontal(_ percent: FPercent)
Set the left, right, start and end margins to the specified value.marginVertical(_ percent: FPercent)
Set the top and bottom margins to the specified value.
Usage examples:
view.flex.margin(20%)
view.flex.marginTop(20%).marginLeft(20%)
view.flex.marginHorizontal(10%)Update Carthage support
1.2.1 Update version to 1.2.1
Many properties can now be reset to their initial state
-
Many properties can be reset to their initial state. Specifying
nilwhen calling these properties reset their value:width(nil)height(nil)size(nil)minWidth(nil)maxWidth(nil)minHeight(nil)maxHeight(nil)aspectRatio(nil)
-
FlexLayout now integrates YogaKit source code, this was needed to improve efficiently the iOS's yoga interface.
AspectRatio can now be reset
AspectRatio can now be reset.
Simply call aspectRatio(nil).
New margin and padding methods, UICollectionView example, iPhone X examples support
-
Add new margin methods:
margin(_ insets: UIEdgeInsets): Set all margins using UIEdgeInsets.
This method is particularly useful to set all margins using iOS 11UIView.safeAreaInsetsmargin(_ directionalInsets: NSDirectionalEdgeInsets): Set margins using NSDirectionalEdgeInsets.
This method is particularly to set all margins using iOS 11UIView.directionalLayoutMargins
-
Add new padding methods:
padding(_ insets: UIEdgeInsets): Set all paddings using UIEdgeInsets.
This method is particularly useful using iOS 11UIView.safeAreaInsetspadding(_ directionalInsets: NSDirectionalEdgeInsets): Set paddings using NSDirectionalEdgeInsets.
This method is particularly useful to set all paddings using iOS 11UIView.directionalLayoutMargins
-
Update all examples to support iPhone X landscape orientation.
-
Add an example of UICollectionView using FlexLayout
width/height methods taking percentage parameter
Add width/height methods taking percentage parameter
* width(_ percent: FPercent)
* height(_ percent: FPercent)
* minWidth(_ percent: FPercent)
* maxWidth(_ percent: FPercent)
* minHeight(_ percent: FPercent)
* maxHeight(_ percent: FPercent)
Usage examples:
* view.flex.width(50%)
* view.flex.height(25%)
* Added by [Luc Dion](https://github.com/lucdion) in Pull Request [#28](https://github.com/lucdion/FlexLayout/pull/28)