diff --git a/DoActionSheet.podspec b/DoActionSheetFork.podspec similarity index 56% rename from DoActionSheet.podspec rename to DoActionSheetFork.podspec index 32c4557..682ec0f 100644 --- a/DoActionSheet.podspec +++ b/DoActionSheetFork.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| - s.name = 'DoActionSheet' - s.version = '1.0' - s.author = { 'JackShi' => 'shiguifei@gmail.com' } - s.homepage = 'https://github.com/donobono/DoActionSheet' + s.name = 'DoActionSheetFork' + s.version = '1.1.2' + s.author = { 'beiliubei' => 'beiliubei@gmail.com' } + s.homepage = 'https://github.com/beiliubei/DoActionSheet.git' s.summary = 'An replacement for UIActionSheet : block-based, customizable theme, easy to use with image or map' s.license = { :type => 'MIT', :file => 'License' } - s.source = { :git => 'https://github.com/donobono/DoActionSheet.git', :tag => '1.0' } + s.source = { :git => 'https://github.com/beiliubei/DoActionSheet.git', :tag => '1.1.2' } s.source_files = 'TestActionSheet/3rdSource/UIImage-ResizeMagick/*.{h,m}','TestActionSheet/DoActionSheet/*.{h,m}' s.platform = :ios s.requires_arc = true diff --git a/README.md b/README.md index ccd8ef1..8c75510 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,15 @@ DoActionSheet - iOS 7.0 and greater - ARC +## ChangeLog +### 1.1.1 +1. custom buttons enable + +### 1.1.2 +1. underLineEnable enable + + @property (assign, nonatomic) BOOL underLineEnable; + ## Examples @@ -86,6 +95,7 @@ vActionSheet.nDestructiveIndex = 2; #define DO_DESTRUCTIVE_TEXT_COLOR DO_RGB(255, 255, 255) ``` + ## Credits DoActionSheet was created by Dono Cho. diff --git a/TestActionSheet/DoActionSheet/DoActionSheet.h b/TestActionSheet/DoActionSheet/DoActionSheet.h index ae34d26..b75c24c 100644 --- a/TestActionSheet/DoActionSheet/DoActionSheet.h +++ b/TestActionSheet/DoActionSheet/DoActionSheet.h @@ -152,6 +152,9 @@ typedef void(^DoActionSheetHandler)(int nResult); // button height @property (readwrite) CGFloat doButtonHeight; +// underline enable +@property (assign, nonatomic) BOOL underLineEnable; + // with cancel button and other buttons - (void)showC:(NSString *)strTitle diff --git a/TestActionSheet/DoActionSheet/DoActionSheet.m b/TestActionSheet/DoActionSheet/DoActionSheet.m index 98fd1da..244e07c 100644 --- a/TestActionSheet/DoActionSheet/DoActionSheet.m +++ b/TestActionSheet/DoActionSheet/DoActionSheet.m @@ -194,11 +194,13 @@ - (void)showActionSheet dHeight = lbTitle.frame.size.height + self.doTitleInset.bottom; // underline - UIView *vLine = [[UIView alloc] initWithFrame:CGRectMake(lbTitle.frame.origin.x, lbTitle.frame.origin.y + lbTitle.frame.size.height - 3, lbTitle.frame.size.width, 0.5)]; - vLine.backgroundColor = (self.doTitleTextColor == nil) ? DO_AS_TITLE_TEXT_COLOR : self.doTitleTextColor; - vLine.alpha = 0.2; - vLine.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; - [_vActionSheet addSubview:vLine]; + if (_underLineEnable) { + UIView *vLine = [[UIView alloc] initWithFrame:CGRectMake(lbTitle.frame.origin.x, lbTitle.frame.origin.y + lbTitle.frame.size.height - 3, lbTitle.frame.size.width, 0.5)]; + vLine.backgroundColor = (self.doTitleTextColor == nil) ? DO_AS_TITLE_TEXT_COLOR : self.doTitleTextColor; + vLine.alpha = 0.2; + vLine.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + [_vActionSheet addSubview:vLine]; + } } else dHeight += self.doTitleInset.bottom; @@ -220,12 +222,16 @@ - (void)showActionSheet // add buttons int nTagIndex = 0; - for (NSString *str in _aButtons) + for (id str in _aButtons) { - UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom]; + UIButton *bt; + if ([str isKindOfClass:[UIButton class]]) { + bt = (UIButton *)str; + }else{ + bt = [UIButton buttonWithType:UIButtonTypeCustom]; + [bt setTitle:str forState:UIControlStateNormal]; + } bt.tag = nTagIndex; - [bt setTitle:str forState:UIControlStateNormal]; - [self setButtonAttributes:bt cancel:NO]; bt.frame = CGRectMake(self.doButtonInset.left, dYContent, _vActionSheet.frame.size.width - (self.doButtonInset.left + self.doButtonInset.right), (self.doButtonHeight > 0) ? self.doButtonHeight : DO_AS_BUTTON_HEIGHT); @@ -239,7 +245,7 @@ - (void)showActionSheet bt.backgroundColor = (self.doDestructiveColor == nil) ? DO_AS_DESTRUCTIVE_COLOR : self.doDestructiveColor; [bt setTitleColor:(self.doDestructiveTextColor == nil) ? DO_AS_DESTRUCTIVE_TEXT_COLOR : self.doDestructiveTextColor forState:UIControlStateNormal]; } - + nTagIndex += 1; }