YVAnchor

master

Faster and easier layout constraints
Shadberrow/YVAnchor

YVAnchor

About

Syntax sugar for working with anchors in swift. Now you will never ever forget to activate your constraint or set translatesAutoresizingMaskIntoConstraints parameter 😜

Usage

Instead of this:

subview.translatesAutoresizingMaskIntoConstraints = false
subview.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 30).isActive = true

Use this:

subview.pin(.left, to: view.left, constant: 30)

Example

Sample layout constraints

Animation

Note

Before constraints setup add all subviews to the view hierarchy.

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 12:06:06 GMT-0900 (Hawaii-Aleutian Daylight Time)