File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN
105105// / @name Showing and hiding
106106
107107/* *
108- * Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
108+ * Finds the top-most HUD subview that hasn't finished and hides it. The counterpart to this method is showHUDAddedTo:animated:.
109109 *
110110 * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden.
111111 *
@@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN
120120+ (BOOL )hideHUDForView : (UIView *)view animated : (BOOL )animated ;
121121
122122/* *
123- * Finds the top-most HUD subview and returns it.
123+ * Finds the top-most HUD subview that hasn't finished and returns it.
124124 *
125125 * @param view The view that is going to be searched.
126126 * @return A reference to the last HUD subview discovered.
Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ + (MBProgressHUD *)HUDForView:(UIView *)view {
8080 NSEnumerator *subviewsEnum = [view.subviews reverseObjectEnumerator ];
8181 for (UIView *subview in subviewsEnum) {
8282 if ([subview isKindOfClass: self ]) {
83- return (MBProgressHUD *)subview;
83+ MBProgressHUD *hud = (MBProgressHUD *)subview;
84+ if (hud.hasFinished == NO ) {
85+ return hud;
86+ }
8487 }
8588 }
8689 return nil ;
You can’t perform that action at this time.
0 commit comments