From 146176914f40153d9074f927fcc9bb00c113eeff Mon Sep 17 00:00:00 2001 From: Grigory Lutkov Date: Fri, 13 Nov 2015 09:58:05 +0300 Subject: [PATCH] Fixed bugs --- LGAlertView.podspec | 2 +- LGAlertView/LGAlertView.m | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/LGAlertView.podspec b/LGAlertView.podspec index a14e63f..e84fad0 100644 --- a/LGAlertView.podspec +++ b/LGAlertView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'LGAlertView' - s.version = '2.0.6' + s.version = '2.0.7' s.platform = :ios, '6.0' s.license = 'MIT' s.homepage = 'https://github.com/Friend-LGA/LGAlertView' diff --git a/LGAlertView/LGAlertView.m b/LGAlertView/LGAlertView.m index 8d3263b..26bd2e2 100644 --- a/LGAlertView/LGAlertView.m +++ b/LGAlertView/LGAlertView.m @@ -1317,7 +1317,7 @@ - (void)setButtonAtIndex:(NSUInteger)index enabled:(BOOL)enabled LGAlertViewCell *cell = (LGAlertViewCell *)[_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]]; cell.enabled = enabled; } - else + else if (_scrollView) { switch (index) { @@ -1339,7 +1339,7 @@ - (void)setButtonAtIndex:(NSUInteger)index enabled:(BOOL)enabled - (BOOL)isButtonEnabledAtIndex:(NSUInteger)index { - return (BOOL)_buttonsEnabledArray[index]; + return [_buttonsEnabledArray[index] boolValue]; } - (void)setButtonPropertiesAtIndex:(NSUInteger)index @@ -1457,7 +1457,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.lineBreakMode = (properties.isUserLineBreakMode ? properties.lineBreakMode : _buttonsLineBreakMode); cell.adjustsFontSizeToFitWidth = (properties.isUserAdjustsFontSizeTofitWidth ? properties.adjustsFontSizeToFitWidth : _buttonsAdjustsFontSizeToFitWidth); cell.minimumScaleFactor = (properties.isUserMinimimScaleFactor ? properties.minimumScaleFactor : _buttonsMinimumScaleFactor); - cell.enabled = (BOOL)_buttonsEnabledArray[indexPath.row - (_destructiveButtonTitle.length ? 1 : 0)]; + cell.enabled = [_buttonsEnabledArray[indexPath.row - (_destructiveButtonTitle.length ? 1 : 0)] boolValue]; } return cell; @@ -2245,7 +2245,7 @@ - (void)subviewsInvalidateWithSize:(CGSize)size _firstButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; else if (textAlignment == NSTextAlignmentRight) _firstButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; - _firstButton.enabled = (BOOL)_buttonsEnabledArray[0]; + _firstButton.enabled = [_buttonsEnabledArray[0] boolValue]; [_firstButton addTarget:self action:@selector(firstButtonAction:) forControlEvents:UIControlEventTouchUpInside]; CGSize size = [_firstButton sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)]; @@ -2284,7 +2284,7 @@ - (void)subviewsInvalidateWithSize:(CGSize)size _secondButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; else if (textAlignment == NSTextAlignmentRight) _secondButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; - _secondButton.enabled = (BOOL)_buttonsEnabledArray[1]; + _secondButton.enabled = [_buttonsEnabledArray[1] boolValue]; [_secondButton addTarget:self action:@selector(secondButtonAction:) forControlEvents:UIControlEventTouchUpInside]; CGSize size = [_secondButton sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)]; @@ -2323,7 +2323,7 @@ - (void)subviewsInvalidateWithSize:(CGSize)size _thirdButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; else if (textAlignment == NSTextAlignmentRight) _thirdButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight; - _thirdButton.enabled = (BOOL)_buttonsEnabledArray[2]; + _thirdButton.enabled = [_buttonsEnabledArray[2] boolValue]; [_thirdButton addTarget:self action:@selector(thirdButtonAction:) forControlEvents:UIControlEventTouchUpInside]; CGSize size = [_thirdButton sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];