SwiftyMasonry
示例
要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install
要求
安装
SwiftyMasonry 通过 CocoaPods 或 Carthage 提供。要安装它,只需将以下行添加到 Podfile 或 Cartfile
CocoaPods
pod 'SwiftyMasonry'
Carthage
github "Pircate/SwiftyMasonry"
用法
view.mas.makeConstraints {
$0.top.equalTo(mas.topLayoutGuide)
$0.left.right.equalTo(superView)
$0.bottom.equalTo(superView).inset(49)
}
view.mas.makeConstraints {
$0.edges.equalTo(superView).insets(UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40))
}
view.mas.makeConstraints {
$0.center.equalTo(superView)
$0.size.mas.equalTo(CGSize(width: 100, height: 100)) // mas.equalTo代替mas_equalTo
}
view.mas.makeConstraints {
$0.top.equalTo(otherView.mas.bottom).offset(20)
$0.left.equalTo(superView).inset(15)
}
作者
Pircate, [email protected]
许可证
SwiftyMasonry 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。