Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Friend-LGA committed Nov 16, 2015
1 parent c8b2b81 commit ee23a56
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
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.10'
s.version = '2.0.11'
s.platform = :ios, '6.0'
s.license = 'MIT'
s.homepage = 'https://github.com/Friend-LGA/LGAlertView'
Expand Down
32 changes: 32 additions & 0 deletions LGAlertView/LGAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,38 @@ - (void)setButtonAtIndex:(NSUInteger)index enabled:(BOOL)enabled
}
}

- (void)setCancelButtonEnabled:(BOOL)cancelButtonEnabled
{
_cancelButtonEnabled = cancelButtonEnabled;

if (_cancelButtonTitle.length)
{
if (_tableView)
{
LGAlertViewCell *cell = (LGAlertViewCell *)[_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:(_buttonTitles.count-1) inSection:0]];
cell.enabled = cancelButtonEnabled;
}
else if (_scrollView)
_cancelButton.enabled = cancelButtonEnabled;
}
}

- (void)setDestructiveButtonEnabled:(BOOL)destructiveButtonEnabled
{
_destructiveButtonEnabled = destructiveButtonEnabled;

if (_destructiveButtonTitle.length)
{
if (_tableView)
{
LGAlertViewCell *cell = (LGAlertViewCell *)[_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
cell.enabled = destructiveButtonEnabled;
}
else if (_scrollView)
_destructiveButton.enabled = destructiveButtonEnabled;
}
}

- (BOOL)isButtonEnabledAtIndex:(NSUInteger)index
{
return [_buttonsEnabledArray[index] boolValue];
Expand Down

0 comments on commit ee23a56

Please sign in to comment.