[window makeKeyWindow];
*stop = YES;
}
}];
// uncomment to make sure UIWindow is gone from app.windows
//NSLog(@"%@", [UIApplication sharedApplication].windows);
//NSLog(@"keyWindow = %@", [UIApplication sharedApplication].keyWindow);
}
}];
});
}
#pragma mark - Utilities
+ (BOOL)isVisible {
return ([SVProgressHUD sharedView].alpha == 1);
}
#pragma mark - Getters
- (UIWindow *)overlayWindow {
if(!overlayWindow) {
overlayWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
overlayWindow.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
overlayWindow.backgroundColor = [UIColor clearColor];
overlayWindow.userInteractionEnabled = NO;
}
return overlayWindow;
}
- (UIView *)hudView {
if(!hudView) {
hudView = [[UIView alloc] initWithFrame:CGRectZero];
hudView.layer.cornerRadius = 10;
hudView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.8];
hudView.autoresizingMask = (UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin);
[self addSubview:hudView];
}
return hudView;
}
if (stringLabel == nil) {
stringLabel = [[UILabel alloc] initWithFrame:CGRectZero];
stringLabel.textColor = [UIColor whiteColor];
stringLabel.backgroundColor = [UIColor clearColor];
stringLabel.adjustsFontSizeToFitWidth = YES;
stringLabel.textAlignment = UITextAlignmentCenter;
stringLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
stringLabel.font = [UIFont boldSystemFontOfSize:16];
stringLabel.shadowColor = [UIColor blackColor];
stringLabel.shadowOffset = CGSizeMake(0, -1);
stringLabel.numberOfLines = 0;
}
if(!stringLabel.superview)
[self.hudView addSubview:stringLabel];
return stringLabel;
}
- (UIImageView *)imageView {
if (imageView == nil)
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
if(!imageView.superview)
[self.hudView addSubview:imageView];
return imageView;
}
- (UIActivityIndicatorView *)spinnerView {
if (spinnerView == nil) {
spinnerView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinnerView.hidesWhenStopped = YES;
spinnerView.bounds = CGRectMake(0, 0, 37, 37);
}
if(!spinnerView.superview)
[self.hudView addSubview:spinnerView];
return spinnerView;
}
- (CGFloat)visibleKeyboardHeight {