Skip to content

Commit

Permalink
Merge pull request #1233 from OrkhanAlikhanov/layout-order-fix
Browse files Browse the repository at this point in the history
Fixed Layout breaks subview ordering
  • Loading branch information
DanielDahan authored May 21, 2019
2 parents 3677b26 + 6191e01 commit 1efc178
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/iOS/Layout/Layout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ public extension UIView {
- Returns: A Layout instance.
*/
func layout(_ child: UIView) -> Layout {
addSubview(child)
if self != child.superview {
addSubview(child)
}

child.translatesAutoresizingMaskIntoConstraints = false
return child.layout
}
Expand Down

0 comments on commit 1efc178

Please sign in to comment.