MasonryHidden
MasonryHidden copied to clipboard
MasonryHidden
What's wrong with Masonry?
Masonry is so convenience. But when a view could hidden any where or any time,we maybe use updateContraint or use properties to link contraint,to active or deactive if necessary.its so troublesome!
MasonryHidden is so convenience to solve above problems!!! focous on Example!!!
Example
//引用头文件
#import "MASConstraint+Hidden.h"
#import "UIView+MasonryHidden.h"
//创建view
UIView *subView0 = [[UIView alloc] init];
[self.view addSubview:subView0];
[subView0 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@20);
make.right.equalTo(@(-20));
//在需要hidden的约束下调用autoHidden()
make.top.equalTo(@50).autoHidden(subView0);
make.height.equalTo(@20).autoHidden(subView0);
}];
subView0.backgroundColor = [UIColor lightGrayColor];
//在相关的方法中调用masonry_hidden
_subView0.masonry_hidden = !_subView0.masonry_hidden;
Gif
Star me
if you feel convenience use masonryhidden,star me pleasure!
Installation
MasonryHidden is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MasonryHidden'
Author
sunny, [email protected]
License
MasonryHidden is available under the MIT license. See the LICENSE file for more info.