Latest 3.0.0
Homepage https://github.com/BetrayalPromise/SmallAutoLayout
License MIT
Platforms ios 8.0
Authors

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$];

view0.size == CGSizeMake(100, 100)

[view0.size$ equalTo:@(CGSizeMake(100, 100))];

view0.center == view1.center

[view0.center$ equalTo:view1.center$];
[view0.center$ equalTo:view1];

view0.safeArea.size == view1.size

[view0.safeAreaGuide$.size$ equalTo:view1.size$];
[view0.safeAreaGuide$.size$ equalTo:view1];

view0.top == view1.top view0.left == view1.left view0.bottom == view1.bottom

[view1.top$.left$.bottom$ equalTo:view1];

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.

Latest podspec

{
    "name": "SmallAutoLayout",
    "version": "3.0.0",
    "summary": "Description of SmallAutoLayout.",
    "description": "NSLayoutConstraint is very difficulty to usenEasy to use Auto",
    "homepage": "https://github.com/BetrayalPromise/SmallAutoLayout",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "BetrayalPromise": "[email protected]"
    },
    "source": {
        "git": "https://github.com/BetrayalPromise/SmallAutoLayout.git",
        "tag": "3.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SmallAutoLayout/SmallAutoLayout.h",
    "public_header_files": "SmallAutoLayout/SmallAutoLayout.h",
    "subspecs": [
        {
            "name": "Layout",
            "source_files": "SmallAutoLayout/Layout/*.{h,m}",
            "public_header_files": "SmallAutoLayout/Layout/*.{h}"
        },
        {
            "name": "Convenience",
            "source_files": "SmallAutoLayout/Convenience/*.{h,m}",
            "public_header_files": "SmallAutoLayout/Convenience/*.{h}"
        }
    ]
}

Pin It on Pinterest

Share This