Add content hugging / compression resistance shortcuts

This commit is contained in:
Robert Payne 2016-08-04 10:27:26 +12:00
parent 8b85ac86d3
commit 200b341492
1 changed files with 36 additions and 0 deletions

View File

@ -176,6 +176,42 @@ public struct ConstraintViewDSL {
} }
} }
public var contentHuggingHorizontalPriority: Float {
get {
return self.view.contentHuggingPriority(for: .horizontal)
}
set {
self.view.setContentHuggingPriority(newValue, for: .horizontal)
}
}
public var contentHuggingVerticalPriority: Float {
get {
return self.view.contentHuggingPriority(for: .vertical)
}
set {
self.view.setContentHuggingPriority(newValue, for: .vertical)
}
}
public var contentCompressionResistanceHorizontalPriority: Float {
get {
return self.view.contentCompressionResistancePriority(for: .horizontal)
}
set {
self.view.setContentHuggingPriority(newValue, for: .horizontal)
}
}
public var contentCompressionResistanceVerticalPriority: Float {
get {
return self.view.contentCompressionResistancePriority(for: .vertical)
}
set {
self.view.setContentCompressionResistancePriority(newValue, for: .vertical)
}
}
internal let view: ConstraintView internal let view: ConstraintView
internal init(view: ConstraintView) { internal init(view: ConstraintView) {