Not sure what was the problem, however when I hide below line in DTAlertView.m
, problem is solved.
previousKeyWindow = DTRetain([[UIApplication sharedApplication] keyWindow]);
문제
I have an app where I am using DTAlertView & KGModal.
All is working perfectly. The only problem comes when I show DTAlertView over KGModal.
Let me explain working scenario.
Below is the scenario which is not working
Any idea what is going on?
Below is the link for sample download of project.
Code I have is as below.
- (IBAction)showModal:(id)sender {
UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(10, 100, 300, 280)];
contentView.backgroundColor = [UIColor blackColor];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(bringAlertBox)
forControlEvents:UIControlEventTouchUpInside];
[button setTitle:@"Show Alert" forState:UIControlStateNormal];
button.frame = CGRectMake(0, 200, 300, 40.0);
button.backgroundColor = [UIColor whiteColor];
button.titleLabel.textColor = [UIColor blackColor];
[contentView addSubview:button];
[[KGModal sharedInstance] showWithContentView:contentView andAnimated:YES];
}
-(void) bringAlertBox {
NSLog(@"bringAlertBox");
DTAlertView *myAl = [DTAlertView alertViewWithTitle:@"WOW Alert" message:@"I like this alertview...." delegate:nil cancelButtonTitle:@"Dismiss" positiveButtonTitle:nil];
[myAl setDismissAnimationWhenButtonClicked:DTAlertViewAnimationSlideTop];
[myAl showWithAnimation:DTAlertViewAnimationSlideBottom];
}
해결책
Not sure what was the problem, however when I hide below line in DTAlertView.m
, problem is solved.
previousKeyWindow = DTRetain([[UIApplication sharedApplication] keyWindow]);