I am using presentModalViewController to try and display a UIView on top of some other views. I call presentModalViewController from controller1. I am trying to display views from controller2.
From controller1 I call controller2 as follows:
- (void) someButtonPressed: (id)sender
{
MyController* controller2 = [ [ MyController alloc ] initWithNibName:nil bundle:nil ];
[self presentModalViewController:controller2 animated:YES];
//[self presentViewController:controller2 animated:NO completion:nil ];
}
In controller2 I then do this:
- (void)viewDidLoad
{
[super viewDidLoad];
if (YES){
UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow];
UIView* master = (UIView*)[keyWindow viewWithTag:100]; // Master is the entire app, but always oriented so top left corner is 0,0.
UIView* newView = [ [ UIView alloc ] initWithFrame:CGRectMake(100, 100, 400, 400) ];
[self setView:newView ];
self.view.backgroundColor = [ UIColor clearColor ];
}
}
The problem is that none of the content from the first controller shows through. I want the previous views to remain visible. Is there any way to make the views from the second controller clear of invisible? The reason I want to do this is because I want the second controller/view to display a transparent layer that will catch all touch events without them getting through to the views managed by controller1.
Thanks very much.