创建 UIStackView 实例的快速 API。
- 链式编程 API
- 提供配置 UIStackView 属性的简单方法
- 更方便地重新加载或更新排列的视图
- 立即反转排列视图的顺序
- iOS 9.0+
- macOS 10.11+
首选的安装方法是使用 CocoaPods。请将以下内容添加到您的 Podfile
pod 'UIStackViewMaker'
将 UIStackViewMaker 目录复制到您的项目中
#import <UIStackViewMaker/UIStackView+STMaker.h>
...
UIStackView * contentStackView = [UIStackView.stMake stConfig:^(STStackViewConfig * _Nonnull config) {
config.stVer.stDistributeFill.stAlignLead.stInsets(UIEdgeInsetsMake(5, 0, 0, 0));
}];
[contentStackView stGroupItems:^(STStackItemMaker * _Nonnull make) {
make.stView(self.nameLabel).stTrailSpacing(5);
make.stView(self.messageLabel);
}];
UIStackViewMaker
使用的是 MIT 许可协议。