Reputation: 913
I have created a second window and add it on top of the default with :
[topWindow makeKeyAndVisible];
topWindow.hidden = NO;
it works but my top window block the access of the application's default window. I want to know if it's possible that if there is no element ( like a button for exemple ) in my top window at a given place of the screen, we can access to the elements of the default window at below.
I hope this is understandable. Sorry for my english. Thanks by advance for your help.
Upvotes: 2
Views: 2310
Reputation: 124997
I have created a second window and add it on top
So, I think the usual expectation is that there's just one window per screen in an iOS app. The docs seem to imply this:
Every app has one window that displays the app’s user interface on an iOS-based device display. If an external display is connected to the device, an app can create a second window to present content on that display as well.
It's possible that iOS simply assumes that there's only one window per screen, and so the hit-testing process only considers one window, probably the key window. Since you're making your second window the key window, I'd suggest making the first window key after you create the second window and see if that changes things. It wouldn't be surprising if the first window then receives touches and the second doesn't. If you find that's the case, you might Subclass UIWindow
, override -hitTest:withEvent:
to pass the event to other windows if no hit view is found, and then use that subclass for both your windows.
Otherwise, if you can't get that to work, consider going back to a single window and using different views instead. Your question is somewhat similar to Make this view appear in every view, inside the app, and my suggestion there to create your own container view controller might help you.
Upvotes: 1