Skip to content

Commit 32d5c02

Browse files
committed
auto dismiss when tap button
1 parent 517ea8b commit 32d5c02

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

FEAlertController/FEAlertController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ -(void)prepareDisplay{
334334
#pragma mark FEAlertContentViewDelegate
335335

336336
-(void)alertControllerButtonAction:(UIButton *)button{
337+
// Dismiss
338+
[self dismiss];
339+
340+
// Callback
337341
NSInteger clickButtonIndex = (button == self.contentView.buttonLeft ? 0 : 1);
338342
if (self.callback) {
339343
self.callback(self,clickButtonIndex);

FEAlertControllerDemo/FEAlertControllerDemo/ViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ - (IBAction)hey:(UIButton *)sender {
3333
highlightButtonIndex:1
3434
callback:^(FEAlertController *alertController, NSInteger buttonIndex) {
3535
NSLog(@"click button index : %@", @(buttonIndex));
36-
[alertController dismiss];
3736
}];
3837

3938
// Animation Image

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ FEAlertController *alertController = [FEAlertController alertWithTitle:@"What ar
3232
highlightButtonIndex:1
3333
callback:^(FEAlertController *alertController, NSInteger buttonIndex) {
3434
NSLog(@"click button index : %@", @(buttonIndex));
35-
[alertController dismiss];
3635
}];
3736
```
3837

0 commit comments

Comments
 (0)