Skip to content

Commit 201c6cd

Browse files
committed
Add hide/show functions.
1 parent 0a5c619 commit 201c6cd

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

MBProgressHUD.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@
118118
*/
119119
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(bool)animated;
120120

121+
/**
122+
* Display the HUD
123+
*/
124+
- (void) show:(BOOL)animated;
125+
126+
/**
127+
* Hide the HUD, this still calls the hudWasHidden delegate.
128+
*/
129+
- (void) hide:(BOOL)animated;
130+
121131
@end
122132

123133

MBProgressHUD.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,17 @@ - (void)layoutAndStyle {
181181

182182
#pragma mark Showing and execution
183183

184+
- (void) show:(BOOL)animated {
185+
[self layoutAndStyle];
186+
[self setNeedsDisplay];
187+
188+
[self showUsingAnimation:animated];
189+
}
190+
191+
- (void) hide:(BOOL)animated {
192+
[self hideUsingAnimation:animated];
193+
}
194+
184195
- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(bool)animated {
185196

186197
[self layoutAndStyle];

0 commit comments

Comments
 (0)