Reputation: 13557
I am working on a little iOS tutorial for my friends but I got a little problem explaining the meaning of the term "RootViewController"
For someone coming from the WinForms or WPF world its not always easy to understand why a window needs a additional ViewController.
Why dont't you place controlls directly on the window and what makes the RootViewController so special?
Upvotes: 0
Views: 630
Reputation: 4920
There are two good guides to understand this topic: View Programming Guide and View Controller Programming Guide.
The simplest answer is, that UIWindow (window) is only container for application, which don't have any visible content themselves.
Upvotes: 0
Reputation: 1748
in iOS, each application generally have only one window, some times there is one external window. this window is the root view of your application.
just like WinForms, each WinForm is a view controller in iOS Application.
In general, iOS application have more than one set of views to display. just like there are several winForm in the windows form application. to navigate between the view sets, organize them to different view (viewController).
about "RootViewController". the difference with other normal view controllers, is , if a view controller is assigned as root view controller, iOS will change the view controller's view frame, For example, in your code, assigned it to the window, iOS will change the view controller's view frame to [UIScreen mainScreen].applicationFrame .
Upvotes: 1