From 6f6c270b01066c04b2ca7373c41f6ca6c51b3c3b Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 9 Nov 2015 13:32:44 +0300 Subject: [PATCH] Fixed bugs --- LGAlertView.podspec | 2 +- LGAlertView/LGAlertView.m | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/LGAlertView.podspec b/LGAlertView.podspec index c9d8c22..ba953ac 100644 --- a/LGAlertView.podspec +++ b/LGAlertView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'LGAlertView' - s.version = '2.0.2' + s.version = '2.0.3' 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 bcdd7aa..bb522b0 100644 --- a/LGAlertView/LGAlertView.m +++ b/LGAlertView/LGAlertView.m @@ -1489,7 +1489,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath { [self destructiveAction:nil]; } - else if (_cancelButtonTitle.length && indexPath.row == _buttonTitles.count-1) + else if (_cancelButtonTitle.length && indexPath.row == _buttonTitles.count-1 && !kLGAlertViewIsCancelButtonSeparate(self)) { [self cancelAction:nil]; } @@ -1811,6 +1811,13 @@ - (void)transitionToAlertView:(LGAlertView *)alertView completionHandler:(void(^ alertView.styleView.hidden = NO; _styleView.hidden = YES; + if (kLGAlertViewIsCancelButtonSeparate(self) && + kLGAlertViewIsCancelButtonSeparate(alertView)) + { + alertView.styleCancelView.hidden = NO; + _styleCancelView.hidden = YES; + } + [UIView animateWithDuration:duration animations:^(void) { @@ -1826,11 +1833,8 @@ - (void)transitionToAlertView:(LGAlertView *)alertView completionHandler:(void(^ alertView.cancelButton.alpha = 0.f; alertView.cancelButton.hidden = NO; - if (!_styleCancelView.alpha) - { + if (!kLGAlertViewIsCancelButtonSeparate(self)) alertView.styleCancelView.alpha = 0.f; - alertView.styleCancelView.hidden = NO; - } } [UIView animateWithDuration:duration @@ -1843,7 +1847,7 @@ - (void)transitionToAlertView:(LGAlertView *)alertView completionHandler:(void(^ { alertView.cancelButton.alpha = 1.f; - if (!alertView.styleCancelView.alpha) + if (!kLGAlertViewIsCancelButtonSeparate(self)) alertView.styleCancelView.alpha = 1.f; } }