Add `Gap` support + Fix "Child already has a owner" Assert
1) Add Gap
support
Add Gap
methods:
columnGap(_ value: CGFloat) -> Flex
rowGap(_ value: CGFloat) -> Flex
gap(_ value: CGFloat) -> Flex
background
After Yoga layout updated to 2.0.0 the gap func added. and as needed by this issue and my company's product, me and my partner @TaekH made feature to use. 🙇♂️
Added by Buseong Kim in Pull Request #241
2) Fix "Child already has a owner" Assert
Upgrading to the latest version of Yoga introduced an assert in YGNodeInsertChild() that was previously removed accidentally (see relevant commit). This assert will throw an error if the node we are trying to add already has an owner. Unfortunately, we can fall into this case quite easily if we move a view between different superviews (as demonstrated in the following contrived example).
Restoring the changes from this old commit c303faa should ensure that any lingering parent references are cleaned up before we call YGNodeInsertChild()