Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin authored and Admin committed Nov 9, 2015
1 parent c033fbe commit 6f6c270
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LGAlertView.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
16 changes: 10 additions & 6 deletions LGAlertView/LGAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down Expand Up @@ -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)
{
Expand All @@ -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
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 6f6c270

Please sign in to comment.