Update README.md
Syntax sugar for working with anchors in swift. Now you will never ever forget to activate your constraint or set translatesAutoresizingMaskIntoConstraints parameter 😜
translatesAutoresizingMaskIntoConstraints
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)
Before constraints setup add all subviews to the view hierarchy.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
YVAnchor
About
Syntax sugar for working with anchors in swift. Now you will never ever forget to activate your constraint or set
translatesAutoresizingMaskIntoConstraintsparameter 😜Usage
Instead of this:
Use this:
Example
Sample layout constraints
Animation
Note
Before constraints setup add all subviews to the view hierarchy.