+(void)alertController:(UIWindow *)alertnew {
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
blurEffectView.tag = 121212;
UIWindow *currentWindow = alertnew;
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.color = [UIColor blackColor];
[spinner startAnimating];
UIView *alertView = [[UIView alloc] initWithFrame:CGRectMake(0,0, 256, 96)];
alertView.backgroundColor = [UIColor whiteColor];
alertView.layer.cornerRadius = 10;
UILabel *sortTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, 256, 20)];
[sortTitle setTextColor : [GlobalData colorWithHexString : @"000000"]];
[sortTitle setBackgroundColor : [UIColor clearColor]];
[sortTitle setFont : [UIFont fontWithName : @"Trebuchet MS" size : 18.0f]];
[sortTitle setText : @"Please Wait..."];
sortTitle.adjustsFontSizeToFitWidth = YES;
sortTitle.textAlignment = NSTextAlignmentCenter;
[alertView addSubview : sortTitle];
UIView *sampleView = [[UIView alloc] initWithFrame:CGRectMake(0,45, 256, 40)];
sampleView.backgroundColor = [UIColor whiteColor];
[sampleView addSubview:spinner];
[alertView addSubview:sampleView];
spinner.center = CGPointMake(sampleView.frame.size.width / 2,
sampleView.frame.size.height / 2);
alertView.center = currentWindow.center;
blurEffectView.frame = currentWindow.bounds;
[blurEffectView addSubview:alertView];
[currentWindow addSubview:blurEffectView];
}
Be the first to comment.