Commit 6191e012 by Orkhan Alikhanov

Fixed Layout breaks subview ordering

parent 3677b268
...@@ -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