Like I understand it, if I would take the View XIB, I had an Content View where I can put UI control elements inside.
But what's an Window then? Isn't that pretty much the same thing?
What are XIB files? From the point of view of the UI designer, XIB files contain the views or windows that you design in Interface Builder – the controls, their layout and properties, and their connections to your code. It is important to understand that on a technical level, XIB files are stored object graphs.
Interface Builder is a software development application for Apple's macOS operating system. It is part of Xcode (formerly Project Builder), the Apple Developer developer's toolset. Interface Builder allows Cocoa and Carbon developers to create interfaces for applications using a graphical user interface.
On the iPhone each app typically has one window and multiple views. In your case you would design your UI in the View XIB and at runtime that would be added to your app's window. You can use the MainWindow XIB to setup a view controller to swap views in and out of your app as needed.
For more information about windows and views see the Windows and Views section of the iPhone Application Programming Guide
A window is two views: the frame view (which contains controls that only AppKit has access to, like the zoom, hide, close, and maximize buttons, and the title bar and proxy icon), and the content view, which you control.
If you're designing an area you're going to embed within another view, or hand off to an API that wants a view (for example, to create a panel or sheet), then use a view. If you're designing something to specifically be a window, like a document window, then use a window.
With a window, you have additional abilities to control its appearance and behavior, for example, to make it modal, give it a proxy icon, list it in the Windows menu, order it relative to other windows, etc. that you can't do with a plain view.
How Windows Work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With