To create a new UIWindow over the main window

UIWindow *window1 = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 320)]; window1.backgroundColor = [UIColor redColor]; window1.windowLevel = UIWindowLevelAlert; [window1 makeKeyAndVisible]; Finally I know why it doesn’t work, because window1 is a method var, and it will lost after the method executed. So I declare a new @property for it, as @property (strong, nonatomic) UIWindow *window2; and change … Read more

UIWindow not showing over content in iOS 13

I was experiencing the same problems while upgrading my code for iOS 13 scenes pattern. With parts of your second code snippet I managed to fix everything so my windows are appearing again. I was doing the same as you except for the last line. Try removing viewController.present(…). Here’s my code: let windowScene = UIApplication.shared … Read more

Advantages, problems, examples of adding another UIWindow to an iOS app?

Starting with Rob’s answer I played around a bit and would like to write down some notes for others trying to get information on this topic: It is not a problem at all to add another UIWindow. Just create one and makeKeyAndVisible. Done. Remove it by making another window visible, then release the one you … Read more

iPhone – Get Position of UIView within entire UIWindow

That’s an easy one: [aView convertPoint:localPosition toView:nil]; … converts a point in local coordinate space to window coordinates. You can use this method to calculate a view’s origin in window space like this: [aView.superview convertPoint:aView.frame.origin toView:nil]; 2014 Edit: Looking at the popularity of Matt__C’s comment it seems reasonable to point out that the coordinates… don’t … Read more