SmallAutoLayout 4.0.3

SmallAutoLayout 4.0.3

Maintained by BetrayalPromise.



  • By
  • BetrayalPromise

SmallAutoLayout

CI Status Version License Platform

NOTICE

1.视图的translatesAutoresizingMaskIntoConstraints属性交由使用者决定 SmallAutoLayout 并不会处理改属性 原因是 可能存在跟frame配合的情况

2.特殊的标记safeAreaGuide$ topGuide$ bottomGuide$必须最先设置

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

view0.width == view1.width

(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0 attribute:(NSLayoutAttributeWidth) relatedBy:(NSLayoutRelationEqual) toItem:view1 attribute:(NSLayoutAttributeNotAnAttribute) multiplier:1.0 constant:0.0];

yeah
[view0.width$ equalTo:view1.width$];

view0.width == view1.width + 10

(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0. attribute:(NSLayoutAttributeWidth) relatedBy:(NSLayoutRelationEqual) toItem:view1 attribute:(NSLayoutAttributeNotAnAttribute) multiplier:1.0 constant:10];

yeah
[view0.width$ equalTo:view1.width$ trim:10];

view0.left == self.view.safeArea.left

(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:view0 attribute:(NSLayoutAttributeLeft) relatedBy:(NSLayoutRelationEqual) toItem:self.view.safeAreaLayoutGuide attribute:(NSLayoutAttributeLeft) multiplier:1.0 constant:0.0];

yeah
[view0.left$ equalTo:self.view.safeAreaGuide$.left$];

view0.top == self.topLayoutGuide.bottom

(狗娘养的API)fuck
[NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:(NSLayoutAttributeBottom) relatedBy:(NSLayoutRelationEqual) toItem:view0 attribute:(NSLayoutAttributeTop) multiplier:1.0 constant:0.0];

yeah
[view0.top$ equalTo:self.topGudie$.bottom$];

Requirements

Installation

SmallAutoLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SmallAutoLayout'

Author

BetrayalPromise, [email protected]

License

SmallAutoLayout is available under the MIT license. See the LICENSE file for more info.