public func
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
190e29bbd2
commit
c23b7fb79a
@ -1,58 +0,0 @@
|
||||
//
|
||||
// NSLayoutAnchor.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Matt Bruce on 6/15/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - NSLayoutAnchor
|
||||
//--------------------------------------------------
|
||||
extension NSLayoutAnchor {
|
||||
// These methods return an inactive constraint of the form thisAnchor = otherAnchor.
|
||||
@discardableResult
|
||||
@objc public func constraint(equalTo anchor: NSLayoutAnchor, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(equalTo: anchor)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(greaterThanOrEqualTo anchor: NSLayoutAnchor, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(greaterThanOrEqualTo: anchor)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(lessThanOrEqualTo anchor: NSLayoutAnchor, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(lessThanOrEqualTo: anchor)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(equalTo anchor: NSLayoutAnchor, constant: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(equalTo: anchor, constant: constant)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(greaterThanOrEqualTo anchor: NSLayoutAnchor, constant: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(greaterThanOrEqualTo: anchor, constant: constant)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(lessThanOrEqualTo anchor: NSLayoutAnchor, constant: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let constraint = self.constraint(lessThanOrEqualTo: anchor, constant: constant)
|
||||
constraint.identifier = identifier
|
||||
return constraint
|
||||
}
|
||||
}
|
||||
@ -1,84 +0,0 @@
|
||||
//
|
||||
// NSLayoutDimension.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Matt Bruce on 6/15/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - NSLayoutDimension
|
||||
//--------------------------------------------------
|
||||
extension NSLayoutDimension {
|
||||
// These methods return an inactive constraint of the form thisVariable = constant.
|
||||
@discardableResult
|
||||
@objc public func constraint(equalToConstant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(equalToConstant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(greaterThanOrEqualToConstant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(greaterThanOrEqualToConstant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(lessThanOrEqualToConstant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(lessThanOrEqualToConstant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
|
||||
// These methods return an inactive constraint of the form thisAnchor = otherAnchor * multiplier.
|
||||
@discardableResult
|
||||
@objc public func constraint(equalTo anchor: NSLayoutDimension, multiplier m: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(equalTo: anchor, multiplier: m)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(greaterThanOrEqualTo anchor: NSLayoutDimension, multiplier m: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(greaterThanOrEqualTo: anchor ,multiplier: m)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(lessThanOrEqualTo anchor: NSLayoutDimension, multiplier m: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(lessThanOrEqualTo: anchor, multiplier: m)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
|
||||
// These methods return an inactive constraint of the form thisAnchor = otherAnchor * multiplier + constant.
|
||||
@discardableResult
|
||||
@objc public func constraint(equalTo anchor: NSLayoutDimension, multiplier m: CGFloat, constant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(equalTo: anchor, multiplier: m, constant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(greaterThanOrEqualTo anchor: NSLayoutDimension, multiplier m: CGFloat, constant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(greaterThanOrEqualTo: anchor, multiplier: m, constant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
@objc public func constraint(lessThanOrEqualTo anchor: NSLayoutDimension, multiplier m: CGFloat, constant c: CGFloat, identifier: String) -> NSLayoutConstraint {
|
||||
let lc = constraint(lessThanOrEqualTo: anchor, multiplier: m, constant: c)
|
||||
lc.identifier = identifier
|
||||
return lc
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ extension UIView {
|
||||
// MARK: - CALayer
|
||||
//--------------------------------------------------
|
||||
extension CALayer {
|
||||
func remove(layerName: String) {
|
||||
public func remove(layerName: String) {
|
||||
guard let sublayers = sublayers else {
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user