constraindWidth

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-09-20 14:12:18 -05:00
parent ae460b8e4f
commit b5f3e37a4c

View File

@ -647,7 +647,14 @@ public enum LayoutDistribution: String, CaseIterable {
case fillProportionally
}
extension LayoutConstraintable where Self: UIView {
public var constrainedWidth: CGFloat {
horizontalPinnedWidth() ?? (superview?.frame.size.width ?? frame.size.width)
}
}
extension LayoutConstraintable {
public func removeConstraints() {
guard let view = self as? UIView, let superview = view.superview else { return }