diff --git a/VDS/Protocols/LayoutConstraintable.swift b/VDS/Protocols/LayoutConstraintable.swift index bee145ad..daf65f3f 100644 --- a/VDS/Protocols/LayoutConstraintable.swift +++ b/VDS/Protocols/LayoutConstraintable.swift @@ -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 }