yulingtianxia / TBActionSheet

A Custom&Powerful Action Sheet For iOS. 一个 ActionSheet 满足所有样式!超高自由度的可定制!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TBAlertController主动dismiss

devcxm opened this issue · comments

建议TBAlertController重写以下方法来主动dismiss,通过adaptiveAlert的话还得使用者来兼容iOS7。
- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion

@devcxm 现在 TBAlertController 就是点击按钮后 dismiss,没太明白你描述的问题。欢迎提个 PR,或者阐述的详细些哈。

我的意思不是通过点击Alert上的按钮来dismiss。比如我弹出一个Alert,需要在3秒后自动dismiss。那么我还要这样做。

if ([self.alertController.adaptiveAlert isKindOfClass:[UIAlertView class]]) { [self.alertController.adaptiveAlert dismissWithClickedButtonIndex:-1 animated:YES]; } else if ([self.alertController.adaptiveAlert isKindOfClass:[UIAlertController class]]) { [self.alertController.adaptiveAlert dismissViewControllerAnimated:YES completion:nil]; } }

@devcxm 嗯了解了,确实有这个必要,等我稍后有空加上