KMUIMaker
使用类似Masonry链式编程的方式初始化UIView、UIButton、UILabel、UIScrollview、UITextView、UITabelView...
Install / Use
/learn @hkm5558/KMUIMakerREADME
KMUIMaker
使用类似Masonry链式编程的方式初始化UIView、UIButton、UILabel、UIScrollview、UITextView、UITabelView...

Installation with CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries. You can install it with the following command:
$ gem install cocoapods
Podfile
To integrate KMUIMaker into your Xcode project using CocoaPods, specify it in your Podfile:
In your Podfile
pod 'KMUIMaker'
Then, run the following command:
$ pod install
Requirements
This library requires iOS 8.0+
Architecture
KMUIMaker
KMUIViewMakerKMLabelMakerKMImageViewMakerKMUIControlMakerKMButtonMakerKMTextFieldMakerKMScrollViewMakerKMTableViewMakerKMCollectionViewMakerKMTextViewMaker
KMUIMakerCategory
UIView+KMUIViewMakerUILabel+KMLabelMakerUIImageView+KMImageViewMakerUIButton+KMButtonMakerUITextField+KMTextFieldMakerUIScrollView+KMScrollViewMakerUITableView+KMTableViewMakerUICollectionView+KMCollectionViewMakerUITextView+KMTextViewMaker
Usage
///UIView
[UIView km_makeView:^(KMUIViewMaker *make) {
make
.frame(CGRectMake(100, 84, 150, 130))
.backgroundColor([UIColor lightGrayColor])
.cornerRadius(5)
.borderWidth(1)
.borderColor([UIColor cyanColor])
.clipsToBounds(YES)
.addToSuperView(self.view)
.addSubview([UILabel km_makeLabel:^(KMLabelMaker *make) {
make
.font([UIFont systemFontOfSize:11])
.text(@"我是Label")
.textColor([UIColor redColor])
.textAlignment(NSTextAlignmentRight)
.userInteractionEnabled(YES)
.addGestureRecognizer([[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapLabel:)])
.frame(CGRectMake(10, 10, 80, 50))
.backgroundColor([UIColor colorWithRed:0.1 green:0.1 blue:0.7 alpha:0.7]);
}]);
}];
///UIButton
[UIButton km_makeButton:^(KMButtonMaker *make) {
make
.titleForState(@"我是Button", UIControlStateNormal)
.titleColorForState([UIColor whiteColor], UIControlStateNormal)
.addTargetAndActionForControlEvents(self, @selector(clickButton:), UIControlEventTouchUpInside)
.frame(CGRectMake(100, 100, 200, 100))
.center(self.view.center)
.backgroundColor([UIColor colorWithRed:1 green:0 blue:0 alpha:0.7])
.cornerRadius(8)
.shadowRadius(3)
.shadowOpacity(1)
.shadowColor([UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.7])
.shadowOffset(CGSizeMake(3, 3))
.addToSuperView(self.view);
}];

Author
hkm5558, SZHuangKM@163.com
License
KMUIMaker is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
