Skip to content

Commit

Permalink
Return a HUD as soon as one is found in HUDForView:
Browse files Browse the repository at this point in the history
  • Loading branch information
dontangg committed Nov 16, 2012
1 parent 0151c89 commit 271252c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MBProgressHUD.m
Expand Up @@ -125,15 +125,14 @@ + (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated {
} }


+ (MBProgressHUD *)HUDForView:(UIView *)view { + (MBProgressHUD *)HUDForView:(UIView *)view {
MBProgressHUD *hud = nil;
NSArray *subviews = view.subviews; NSArray *subviews = view.subviews;
Class hudClass = [MBProgressHUD class]; Class hudClass = [MBProgressHUD class];
for (UIView *aView in subviews) { for (UIView *aView in subviews) {
if ([aView isKindOfClass:hudClass]) { if ([aView isKindOfClass:hudClass]) {
hud = (MBProgressHUD *)aView; return (MBProgressHUD *)aView;
} }
} }
return hud; return nil;
} }


+ (NSArray *)allHUDsForView:(UIView *)view { + (NSArray *)allHUDsForView:(UIView *)view {
Expand Down

0 comments on commit 271252c

Please sign in to comment.