苏瑞海

1pod

NSLayoutConstraint-SSLayout

NSLayoutConstraint-SSLayout

简单易用,仅2个文件,17KB大小。
用法类似于NSLayoutAnchor,但支持iOS-8和“可Swift化”。
比Masonry快1.7倍,几乎与系统方法一样快。
跟踪所有约束,易于激活/停用任何一个。

示例

设置约束

[self.redView activateConstraints:^{ self.redView.height_attr.constant = 100; self.redView.width_attr = self.blueView.width_attr; self.redView.top_attr = self.blueView.top_attr; self.redView.leading_attr = self.blueView.trailing_attr;    }];

修改约束值

self.blueView.width_attr.constant = 100;

获取约束

NSLayoutConstraint *cons = [self.titleLabel constraintAccordingToAttribute:self.titleLabel.bottom_attr andAttribute:self.subtitleLabel.top_attr];

添加到您的项目

使用CocoaPods

将pod 'SSBannerViewController' 添加到您的Podfile。

直接将源代码集成到您的项目中

将“Source”文件夹下的文件添加到您的项目中。

许可证

本项目使用MIT许可证。

许可证: MIT

  • Objective C