Commit 1efc1784 by Daniel Jonathan Committed by GitHub

Merge pull request #1233 from OrkhanAlikhanov/layout-order-fix

Fixed Layout breaks subview ordering
parents 3677b268 6191e012
...@@ -41,7 +41,10 @@ public extension UIView { ...@@ -41,7 +41,10 @@ public extension UIView {
- Returns: A Layout instance. - Returns: A Layout instance.
*/ */
func layout(_ child: UIView) -> Layout { func layout(_ child: UIView) -> Layout {
addSubview(child) if self != child.superview {
addSubview(child)
}
child.translatesAutoresizingMaskIntoConstraints = false child.translatesAutoresizingMaskIntoConstraints = false
return child.layout return child.layout
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment