Questions tagged [uiwindow]

The UIWindow class defines objects (known as windows ) that manage and coordinate the windows an application displays on the screen.

In iOS, windows and views are used to present application’s content on the screen. Windows do not have any visible content themselves but provide a basic container for application’s views. The two principal functions of a window are to provide an area for displaying its views and to distribute events to the views. The window is the root view in the view hierarchy. A window belongs to a level; the windows in one level appear above another level. For example, alerts appear above normal windows. Typically, there is only one window in an iOS application.

627 questions
9
votes
3 answers

What is the purpose of UIWindow?

I've always seen references to an app's 'window', and I see that AppDelegates usually have a UIWindow property called 'window'. So I'm just wondering how to perceive this UIWindow object. I see that it's a subclass of UIView, so I guess technically…
hgwhittle
  • 8,916
  • 6
  • 45
  • 59
8
votes
2 answers

How to use multiple iOS custom view controllers without a navigation controller

I am building an app that uses multiple types of screens--all which warrant their own custom view controllers. I am successfully switching between view controllers and their related views by reassigning the main window's rootViewController with a…
GarlicFries
  • 7,375
  • 4
  • 33
  • 52
8
votes
7 answers

Height and width on iPhone (/iPad)

This is just a test application, There is only a AppDelegate class to create all I did was create a Window based app, set the supported orientations to only the landscape in the info.plist, and then add the following code: -…
Jonathan.
  • 51,850
  • 46
  • 174
  • 275
8
votes
2 answers

iOS9: Custom UIWindow makes status bar disappear

When I create a custom UIWindow in iOS9, the window becomes visible on the screen, but the status bar suddenly disappears. When the window becomes hidden, the status bar appears again. Below, 2 screenshots of what I get on iOS9 with Xcode7…
Runo Sahara
  • 695
  • 8
  • 23
8
votes
6 answers

Dismiss all UIAlertControllers currently presented

Is there a way to dismiss all UIAlertControllers that are currently presented? This is specifically because from anywhere and any state of my app, I need to get to a certain ViewController when a push notification is pressed.
David
  • 6,021
  • 8
  • 39
  • 85
8
votes
2 answers

UIWindow frame in ios 8 different from ios 7 in Landscape

I've create simple module where I add subview to UIWindow. In simulator ios 7(Xcode 5.1.1) I have printed self.windows and I get: ; layer =…
edzio27
  • 4,048
  • 6
  • 29
  • 48
7
votes
2 answers

UIView subview of UIWindow doesn't rotate

I'm adding a UIView to a UIWindow that's not the keyWindow. I'd like the UIView to rotate when the device rotates. Any special properties on the window or the view I need to set? Currently the view is not rotating. I'm aware of the fact that only…
SundayMonday
  • 17,607
  • 27
  • 94
  • 151
7
votes
1 answer

UIWindow not visible on top of Storyboard

I have a UIWindow object that I have want to show on top a Storyboard. That I made like this - UIWindow *webWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 20, 320,480)]; webWindow.windowLevel = UIWindowLevelAlert; I am making it…
arank
  • 221
  • 3
  • 10
7
votes
1 answer

How to detect window resizing in Mac Catalyst?

How can I a get a notification when user resize the window while: NotificationCenter.default.addObserver(self, selector: #selector(function), name: NSWindowDidResizeNotification, object: nil) is unavailable in Mac Catalyst
Mansour
  • 479
  • 2
  • 7
  • 19
7
votes
4 answers

Putting a UIView or UIWindow above Statusbar

My goal is to draw an invisible button above the status bar on the top of my iPhone app (dimension 320*20 pixels). No matter what I try, something is buggy: For example, I tried to create a new view. When I want to place the view on the top of my…
andreas
  • 7,242
  • 8
  • 46
  • 70
7
votes
1 answer

iOS9 covering status bar with custom uiwindow - wrong position

I am trying to cover status bar with my own view and to do that I calculcate frame for my view by doing something like that (also after rotation): UIScreen *screen = [UIScreen mainScreen]; CGRect statusBarFrame = [UIApplication…
Artrmz
  • 340
  • 2
  • 14
7
votes
5 answers

Unknown error [UIWindow endDisablingInterfaceAutorotation]

I am receiving this error. I have no clue as to why it would be called, and Google didn't really help. Any suggestions? -[UIWindow endDisablingInterfaceAutorotation] called on
iAm
  • 209
  • 3
  • 5
  • 12
7
votes
2 answers

iOS self.window - when is it created?

when you start your app using single view template, and you add the NSLog(@"self.window = %@", self.window); in your first line of the AppDelegate.m's application: didFinishLaunchingWithOptions: method, you can see that self.window exists in your…
Blaszard
  • 27,599
  • 40
  • 143
  • 217
6
votes
2 answers

Can't change the size of a UIWindow

I'm trying to add a new window on top of my current one, on an iPad application, but I can't figure out why it always presents itself as fullscreen. I'm using this code: UIWindow *window = [[UIWindow alloc]initWithFrame:CGRectMake(0, 0, 20,…
the Reverend
  • 11,251
  • 9
  • 58
  • 106
6
votes
1 answer

UIWindow not filling screen for new devices?

I'm working with an old Xcode project which is roughly 7/8 years old and I've migrated it to Objective-C 2.0 and to support ARC. The project didn't support Auto-Layout (this was just before it was released) prior to me working on it. I've managed to…
Luke97
  • 307
  • 1
  • 10
  • 23