Releases: layoutBox/FlexLayout
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
nil
when 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.safeAreaInsets
margin(_ 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.safeAreaInsets
padding(_ 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)
Add Carthage support
Improved the Align enumeration
Replace the unique Align enumeration by 3 enumerations:
- AlignContent
- AlignItems
- AlignSelf
They all have different options, which make the API cleaner.
Plus:
- Removed the overflow() method for now.
addContainer() renamed addItem(), markDirty()
- Add missing markDirty() method
⚠️ BREAKING CHANGE: Renamed the methodaddContainer()
to `addItem(). It is clearer that the added view is in fact a flex item, and not just a flex container.- Add an implementation of the Ray Wenderlich Yoga Tutorial
- Add Swift 4.0 support