Graphics Programs Reference
In-Depth Information
Setting a view controller as the
rootViewController
of a window adds that view
could write
setRootViewController:
yourself:
- (void)setRootViewController:(UIViewController *)vc
{
// Get the view of the root view controller
UIView *rootView = [vc view];
// Make a frame that fits the window's bounds
CGRect viewFrame = [self bounds];
[rootView setFrame:viewFrame];
// Insert this view as window's subview
[self addSubview:rootView];
}
(This method does are a few more things, but this is what we are interested in right now).