Skip to content

Commit

Permalink
Added HUD as parameter to delegate-call
Browse files Browse the repository at this point in the history
  • Loading branch information
myell0w committed Nov 14, 2010
1 parent b1aeb86 commit 66ff32a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Demo/Classes/HudDemoViewController.m
Expand Up @@ -238,7 +238,8 @@ - (void)myMixedTask {
#pragma mark -
#pragma mark MBProgressHUDDelegate methods

- (void)hudWasHidden {
- (void)hudWasHidden:(MBProgressHUD *)hud {
NSLog(@"Hud: %@", hud);
// Remove HUD from screen when the HUD was hidded
[HUD removeFromSuperview];
[HUD release];
Expand Down
10 changes: 9 additions & 1 deletion Demo/HudDemo.xcodeproj/project.pbxproj
Expand Up @@ -167,7 +167,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -243,9 +250,10 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Debug;
};
Expand Down
4 changes: 3 additions & 1 deletion MBProgressHUD.h
Expand Up @@ -48,14 +48,16 @@ typedef enum {

/////////////////////////////////////////////////////////////////////////////////////////////

@class MBProgressHUD;

@protocol MBProgressHUDDelegate <NSObject>

@required

/**
* A callback function that is called after the HUD was fully hidden from the screen.
*/
- (void)hudWasHidden;
- (void)hudWasHidden:(MBProgressHUD *)hud;

@end

Expand Down
4 changes: 2 additions & 2 deletions MBProgressHUD.m
Expand Up @@ -488,8 +488,8 @@ - (void)done {
self.alpha = 0.0;

if(delegate != nil && [delegate conformsToProtocol:@protocol(MBProgressHUDDelegate)]) {
if([delegate respondsToSelector:@selector(hudWasHidden)]) {
[delegate performSelector:@selector(hudWasHidden)];
if([delegate respondsToSelector:@selector(hudWasHidden:)]) {
[delegate performSelector:@selector(hudWasHidden:) withObject:self];
}
}

Expand Down

0 comments on commit 66ff32a

Please sign in to comment.