diff --git a/ATMHud.h b/ATMHud.h index ebc5476..cc250eb 100644 --- a/ATMHud.h +++ b/ATMHud.h @@ -36,6 +36,7 @@ typedef enum { BOOL shadowEnabled; BOOL blockTouches; BOOL allowSuperviewInteraction; + BOOL removeViewWhenHidden; NSString *showSound; NSString *updateSound; @@ -66,6 +67,7 @@ typedef enum { @property (nonatomic, assign) BOOL shadowEnabled; @property (nonatomic, assign) BOOL blockTouches; @property (nonatomic, assign) BOOL allowSuperviewInteraction; +@property (nonatomic, assign) BOOL removeViewWhenHidden; @property (nonatomic, retain) NSString *showSound; @property (nonatomic, retain) NSString *updateSound; diff --git a/ATMHud.m b/ATMHud.m index 4c29853..f7f40db 100644 --- a/ATMHud.m +++ b/ATMHud.m @@ -274,6 +274,7 @@ - (void)construct { center = CGPointZero; blockTouches = NO; allowSuperviewInteraction = NO; + removeViewWhenHidden = NO; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { diff --git a/ATMHudView.m b/ATMHudView.m index dc8d679..6310cd5 100644 --- a/ATMHudView.m +++ b/ATMHudView.m @@ -398,6 +398,7 @@ - (void)applyWithMode:(ATMHudApplyMode)mode { if ([(id)p.delegate respondsToSelector:@selector(hudDidAppear:)]) { [p.delegate hudDidAppear:p]; } + } }]; }]; @@ -520,6 +521,10 @@ - (void)applyWithMode:(ATMHudApplyMode)mode { if ([(id)p.delegate respondsToSelector:@selector(hudDidDisappear:)]) { [p.delegate hudDidDisappear:p]; } + if (p.removeViewWhenHidden) { + [self removeFromSuperview]; + p.view = nil; + } } }]; break;