File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,13 +108,20 @@ typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
108108 */
109109@property (nonatomic , copy ) SCLAttributedFormatBlock attributedFormatBlock;
110110
111- /* * Set button format block.
111+ /* * Set Complete button format block.
112112 *
113113 * Holds the button format block.
114- * Support keys : backgroundColor, textColor
114+ * Support keys : backgroundColor, borderColor, textColor
115115 */
116116@property (nonatomic , copy ) CompleteButtonFormatBlock completeButtonFormatBlock;
117117
118+ /* * Set button format block.
119+ *
120+ * Holds the button format block.
121+ * Support keys : backgroundColor, borderColor, textColor
122+ */
123+ @property (nonatomic , copy ) ButtonFormatBlock buttonFormatBlock;
124+
118125/* * Hide animation type
119126 *
120127 * Holds the hide animation type.
Original file line number Diff line number Diff line change @@ -529,6 +529,12 @@ - (SCLButton *)addDoneButtonWithTitle:(NSString *)title
529529- (SCLButton *)addButton : (NSString *)title actionBlock : (SCLActionBlock)action
530530{
531531 SCLButton *btn = [self addButton: title];
532+
533+ if (_buttonFormatBlock != nil )
534+ {
535+ btn.buttonFormatBlock = _buttonFormatBlock;
536+ }
537+
532538 btn.actionType = Block;
533539 btn.actionBlock = action;
534540 [btn addTarget: self action: @selector (buttonTapped: ) forControlEvents: UIControlEventTouchUpInside];
@@ -774,6 +780,7 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
774780 {
775781 [btn setTitleColor: [UIColor blackColor ] forState: UIControlStateNormal];
776782 }
783+ btn.defaultBackgroundColor = viewColor;
777784
778785 if (btn.completeButtonFormatBlock != nil )
779786 {
@@ -783,10 +790,6 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
783790 {
784791 [btn parseConfig: btn.buttonFormatBlock ()];
785792 }
786- else
787- {
788- btn.defaultBackgroundColor = viewColor;
789- }
790793 }
791794
792795 // Adding duration
You can’t perform that action at this time.
0 commit comments