@@ -30,22 +30,24 @@ public class RelationalConstraintBuilder: ConstraintBuilder {
30
30
init ( first firstConstrainable: Constrainable , second secondConstrainable: Constrainable ) {
31
31
self . firstConstrainable = firstConstrainable
32
32
self . secondConstrainable = secondConstrainable
33
-
34
- if let view = firstConstrainable as? UIView {
35
- view. translatesAutoresizingMaskIntoConstraints = false
36
- if view. superview == nil {
33
+
34
+ UIView . performWithoutAnimation {
35
+ if let view = firstConstrainable as? UIView {
36
+ view. translatesAutoresizingMaskIntoConstraints = false
37
+ if view. superview == nil {
38
+ if let otherView = secondConstrainable as? UIView {
39
+ otherView. addSubview ( view)
40
+ } else if let otherLayoutGuide = secondConstrainable as? UILayoutGuide , let otherView = otherLayoutGuide. owningView {
41
+ otherView. addSubview ( view)
42
+ }
43
+ }
44
+ } else if let layoutGuide = firstConstrainable as? UILayoutGuide , layoutGuide. owningView == nil {
37
45
if let otherView = secondConstrainable as? UIView {
38
- otherView. addSubview ( view )
39
- } else if let otherLayoutGuide = secondConstrainable as? UILayoutGuide , let otherView = otherLayoutGuide . owningView {
40
- otherView. addSubview ( view )
46
+ otherView. addLayoutGuide ( layoutGuide )
47
+ } else if let otherGuide = secondConstrainable as? UILayoutGuide , let otherView = otherGuide . owningView {
48
+ otherView. addLayoutGuide ( layoutGuide )
41
49
}
42
50
}
43
- } else if let layoutGuide = firstConstrainable as? UILayoutGuide , layoutGuide. owningView == nil {
44
- if let otherView = secondConstrainable as? UIView {
45
- otherView. addLayoutGuide ( layoutGuide)
46
- } else if let otherGuide = secondConstrainable as? UILayoutGuide , let otherView = otherGuide. owningView {
47
- otherView. addLayoutGuide ( layoutGuide)
48
- }
49
51
}
50
52
}
51
53
}
0 commit comments