Skip to content

Commit

Permalink
Actually remove window when HUD is dismissed
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Mar 23, 2011
1 parent c1e1c6c commit 8f077b6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions SSToolkit/SSHUDView.m
Expand Up @@ -96,8 +96,7 @@ - (id)initWithTitle:(NSString *)aTitle {
- (id)initWithTitle:(NSString *)aTitle loading:(BOOL)isLoading {
if ((self = [super initWithFrame:CGRectZero])) {
self.backgroundColor = [UIColor clearColor];

_hudWindow = [[SSHUDWindow alloc] init];

_hudSize = CGSizeMake(172.0f, 172.0f);

// Indicator
Expand Down Expand Up @@ -130,6 +129,10 @@ - (id)initWithTitle:(NSString *)aTitle loading:(BOOL)isLoading {


- (void)show {
if (!_hudWindow) {
_hudWindow = [[SSHUDWindow alloc] init];
}

_hudWindow.alpha = 0.0f;
self.alpha = 0.0f;
[_hudWindow addSubview:self];
Expand Down Expand Up @@ -218,10 +221,11 @@ - (void)dismissAnimated:(BOOL)animated {
[UIView commitAnimations];

if (animated) {
[_hudWindow fadeOutAndPerformSelector:@selector(resignKeyWindow)];
} else {
[_hudWindow resignKeyWindow];
[_hudWindow fadeOut];
}
[_hudWindow resignKeyWindow];
[_hudWindow release];
_hudWindow = nil;
}


Expand Down Expand Up @@ -266,8 +270,8 @@ - (void)_setTransformForCurrentOrientation:(BOOL)animated {
else {
degrees = 90;
}
// Portrait
// Portrait
} else {
degrees = orientation == UIInterfaceOrientationPortraitUpsideDown ? 180 : 0;
}
Expand Down

0 comments on commit 8f077b6

Please sign in to comment.