Search code examples
ioscocoa-touchuikituiwindow

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 it's a View right? So would it be safe to say it's like the Superview of an entire app? Also, when and why might I ever refer to it? What value does it add?

I know there are a lot of questions in there but just some overall context on UIWindow would be nice.


Solution

  • You might want to check out the About Windows and Views section in the View Programming Guide for iOS.

    In iOS, you use windows and views to present your application’s content on the screen. Windows do not have any visible content themselves but provide a basic container for your application’s views. Views define a portion of a window that you want to fill with some content. For example, you might have views that display images, text, shapes, or some combination thereof. You can also use views to organize and manage other views.

    Also note that an iOS application usually only has one window. An exception would be, if an app displays content on an external screen.