UIView
extension UIView
We add a couple of ways to deal with first responders.
-
This creates a constraint, locking the view to a given aspect ratio.
Declaration
Swift
@MainActor func autoLayoutAspectConstraint(aspectRatio inAspect: CGFloat) -> NSLayoutConstraint?Parameters
aspectRatioThe aspect ratio. It is W/H, so numbers less than 1.0 are wider than tall, and numbers greater than 1.0 are taller than wide.
Return Value
An inactive constraint, locking this view to the given aspect ratio.
View on GitHub