Skip to content

Commit 66ff32a

Browse files
committed
Added HUD as parameter to delegate-call
1 parent b1aeb86 commit 66ff32a

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

Demo/Classes/HudDemoViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ - (void)myMixedTask {
238238
#pragma mark -
239239
#pragma mark MBProgressHUDDelegate methods
240240

241-
- (void)hudWasHidden {
241+
- (void)hudWasHidden:(MBProgressHUD *)hud {
242+
NSLog(@"Hud: %@", hud);
242243
// Remove HUD from screen when the HUD was hidded
243244
[HUD removeFromSuperview];
244245
[HUD release];

Demo/HudDemo.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,14 @@
167167
isa = PBXProject;
168168
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HudDemo" */;
169169
compatibilityVersion = "Xcode 3.1";
170+
developmentRegion = English;
170171
hasScannedForEncodings = 1;
172+
knownRegions = (
173+
English,
174+
Japanese,
175+
French,
176+
German,
177+
);
171178
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
172179
projectDirPath = "";
173180
projectRoot = "";
@@ -243,9 +250,10 @@
243250
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
244251
GCC_WARN_ABOUT_RETURN_TYPE = YES;
245252
GCC_WARN_UNUSED_VARIABLE = YES;
253+
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
246254
ONLY_ACTIVE_ARCH = YES;
247255
PREBINDING = NO;
248-
SDKROOT = iphoneos4.0;
256+
SDKROOT = iphoneos;
249257
};
250258
name = Debug;
251259
};

MBProgressHUD.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ typedef enum {
4848

4949
/////////////////////////////////////////////////////////////////////////////////////////////
5050

51+
@class MBProgressHUD;
52+
5153
@protocol MBProgressHUDDelegate <NSObject>
5254

5355
@required
5456

5557
/**
5658
* A callback function that is called after the HUD was fully hidden from the screen.
5759
*/
58-
- (void)hudWasHidden;
60+
- (void)hudWasHidden:(MBProgressHUD *)hud;
5961

6062
@end
6163

MBProgressHUD.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ - (void)done {
488488
self.alpha = 0.0;
489489

490490
if(delegate != nil && [delegate conformsToProtocol:@protocol(MBProgressHUDDelegate)]) {
491-
if([delegate respondsToSelector:@selector(hudWasHidden)]) {
492-
[delegate performSelector:@selector(hudWasHidden)];
491+
if([delegate respondsToSelector:@selector(hudWasHidden:)]) {
492+
[delegate performSelector:@selector(hudWasHidden:) withObject:self];
493493
}
494494
}
495495

0 commit comments

Comments
 (0)