Latest 1.1
Homepage https://github.com/ACommonChinese/BMAutoLayout
License MIT
Platforms ios 11.0, requires ARC
Frameworks UIKit
Authors

The Masonry did not update for Objective-C, so i copy the codes and change something to support it based on NSLayoutConstraint Anchor. BMAutoLayout just support iOS now.

Copy the dir BMAutoLayout or use pod:

pod 'BMAutoLayout'

Take an example:

#import <BMAutoLayout/BMAutoLayout.h>

... 

[view_1 bm_makeConstraints:^(BMConstraintMaker *make) {
    make.edges.equalTo(otherView).insets(UIEdgeInsetsMake(5, 10, 15, 20));
}];

...

[view_2 bm_makeConstraints:^(BMConstraintMaker *make) {
    make.top.equalTo(@20);
    make.left.equalTo(@20);
    make.bottom.equalTo(@-20);
    make.right.equalTo(@-20);
}];

...

[view_3 bm_makeConstraints:^(BMConstraintMaker *make) {
     make.top.equalTo(greenView.bottomAnchor).offset(padding);
     make.left.equalTo(superview.leftAnchor).offset(padding);
     make.bottom.equalTo(superview.safeAreaLayoutGuide.bottomAnchor).offset(-padding);
     make.right.equalTo(superview.rightAnchor).offset(-padding);
     make.height.equalTo(@[greenView.heightAnchor, redView.heightAnchor]);
 }];

...

Latest podspec

{
    "name": "BMAutoLayout",
    "version": "1.1",
    "summary": "Autolayout based on anchor",
    "homepage": "https://github.com/ACommonChinese/BMAutoLayout",
    "license": "MIT",
    "platforms": {
        "ios": "11.0"
    },
    "authors": {
        "ACommonChinese": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ACommonChinese/BMAutoLayout.git",
        "tag": "1.1"
    },
    "source_files": "BMAutoLayout/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This