SHelpButton
对系统UIButton控件进行简单封装,简化平时代码编写量,并对点击事件用Block替代。
Usage
SHelpButton *testButton = [SHelpButton buttonWithType:UIButtonTypeCustom];
testButton.frame = CGRectMake(100, 100, 50, 44);
testButton.backgroundColor = [UIColor grayColor];
testButton.normalTtile = @"Test";
testButton.normalTitleColor = [UIColor whiteColor];
[self.view addSubview:testButton];
[testButton addTouchUpInsideBlock:^(SHelpButton *button) {
NSLog(@"clicked ....001");
}];
EventTouchUpInsideBlock block2 = ^(SHelpButton *button) {
NSLog(@"clicked ....002");
};
[testButton addTouchUpInsideBlock:block2];
[testButton addTouchUpInsideBlock:^(SHelpButton *button) {
NSLog(@"clicked ....003");
}];
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
SHelpButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
source 'https://github.com/songzhibing/SHelpButton.git'
platform :ios, '7.0'
target 'TargetName' do
pod 'SHelpButton', '~> 0.1.6'
end
Author
宋直兵, [email protected]
License
SHelpButton is available under the MIT license. See the LICENSE file for more info.