Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Sources/Stevia/Stevia+Constraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import UIKit

public class SteviaLayoutConstraint: NSLayoutConstraint {
public static var defaultPriority: Float = UILayoutPriority.defaultHigh + 1
public static var defaultPriority: Float = UILayoutPriority.defaultHigh.rawValue + 1
}


Expand Down Expand Up @@ -106,6 +106,20 @@ public extension UIView {
c is SteviaLayoutConstraint
}
}

@MainActor
@discardableResult
func removeUserAddedConstraints() -> Self {
removeConstraints(userAddedConstraints.filter {
$0.firstItem === self
})
if let superview {
superview.removeConstraints(superview.userAddedConstraints.filter {
$0.firstItem === self
})
}
return self
}
}

// MARK: - Other
Expand Down