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,10 +297,16 @@ public class Constraint {
|
|||
} else {
|
||||
installOnView = self.fromItem.view?.superview
|
||||
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()
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var layoutConstraints: Array<LayoutConstraint> = []
|
||||
let layoutFromAttributes = self.fromItem.attributes.layoutAttributes
|
||||
|
|
Loading…
Reference in New Issue