Permalink
Browse files

Return a HUD as soon as one is found in HUDForView:

  • Loading branch information...
1 parent 0151c89 commit 271252c1921eba489d77387c41ed5eba421ae71b @dontangg dontangg committed Nov 16, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 MBProgressHUD.m
View
@@ -125,15 +125,14 @@ + (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated {
}
+ (MBProgressHUD *)HUDForView:(UIView *)view {
- MBProgressHUD *hud = nil;
NSArray *subviews = view.subviews;
Class hudClass = [MBProgressHUD class];
for (UIView *aView in subviews) {
if ([aView isKindOfClass:hudClass]) {
- hud = (MBProgressHUD *)aView;
+ return (MBProgressHUD *)aView;
}
}
- return hud;
+ return nil;
}
+ (NSArray *)allHUDsForView:(UIView *)view {

0 comments on commit 271252c

Please sign in to comment.