mirror of https://github.com/SnapKit/SnapKit
Allow size attributes to be installed on a view itself
This commit is contained in:
parent
21a73287f3
commit
c75495cf4c
|
@ -297,8 +297,14 @@ public class Constraint {
|
||||||
} else {
|
} else {
|
||||||
installOnView = self.fromItem.view?.superview
|
installOnView = self.fromItem.view?.superview
|
||||||
if installOnView == nil {
|
if installOnView == nil {
|
||||||
|
if self.fromItem.attributes == ConstraintAttributes.Width || self.fromItem.attributes == ConstraintAttributes.Height {
|
||||||
|
installOnView = self.fromItem.view
|
||||||
|
}
|
||||||
|
|
||||||
|
if installedOnView == nil {
|
||||||
NSException(name: "Cannot Install Constraint", reason: "Missing superview", userInfo: nil).raise()
|
NSException(name: "Cannot Install Constraint", reason: "Missing superview", userInfo: nil).raise()
|
||||||
return []
|
return []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue