Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

removeViewWhenHidden property added #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ATMHud.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ typedef enum {
BOOL shadowEnabled;
BOOL blockTouches;
BOOL allowSuperviewInteraction;
BOOL removeViewWhenHidden;

NSString *showSound;
NSString *updateSound;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions ATMHud.m
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ - (void)construct {
center = CGPointZero;
blockTouches = NO;
allowSuperviewInteraction = NO;
removeViewWhenHidden = NO;
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
Expand Down
5 changes: 5 additions & 0 deletions ATMHudView.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ - (void)applyWithMode:(ATMHudApplyMode)mode {
if ([(id)p.delegate respondsToSelector:@selector(hudDidAppear:)]) {
[p.delegate hudDidAppear:p];
}

}
}];
}];
Expand Down Expand Up @@ -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;
Expand Down