Skip to content

Commit

Permalink
QMUIToastView bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoon committed Mar 20, 2017
1 parent eecc77f commit 5fd9268
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions QMUIKit/UIComponents/QMUIToastView.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,18 @@ + (void)setDefaultAppearance {

@implementation QMUIToastView (ToastTool)

+ (BOOL)hideToastInView:(UIView *)view animated:(BOOL)animated {
QMUIToastView *toast = [self toastInView:view];
if (toast != nil) {
toast.removeFromSuperViewWhenHide = YES;
[toast hideAnimated:animated];
return YES;
}
+ (BOOL)hideAllToastInView:(UIView *)view animated:(BOOL)animated {
NSArray *toastViews = [self allToastInView:view];
BOOL returnFlag = NO;
for (QMUIToastView *toastView in toastViews) {
if (toastView) {
toastView.removeFromSuperViewWhenHide = YES;
[toastView hideAnimated:animated];
returnFlag = YES;
}
return NO;
}

}
return returnFlag;
+ (BOOL)hideAllToastInView:(UIView *)view animated:(BOOL)animated {
QMUIToastView *toast = [self toastInView:view];
if (toast != nil) {
Expand Down

0 comments on commit 5fd9268

Please sign in to comment.