Hi everyone. I'm currently learning Objective-C, coming from a Java background where I have no trouble making GUI applications. As such, the way I'm thinking about some of these problems may be a bit off. Here's the question (please excuse the ramble) -
What is the purpose of UIViewController?
Let me give a specific example. Say you're creating a one-view app that uses a bunch of GUI widgets. You can lay them out by hand in code or you can use InterfaceBuilder. In other languages such as Java and HTML, I always code things by hand and don't use GUI tools as I've found that they haven't allowed me to do the customization I've required. Having said that, I've heard that InterfaceBuilder is the Sweetness (do experts do it by hand?). So let's say I lay out a bunch of widgets in a XIB file and then want to load this UIView in code.
It seems to me (am I wrong?) that one needs to use a UIViewController in order to have proper de-nibbing of a UIView, but for my apps purposes, I have no use for the controller itself (let's leave MVC aside here for a minute). So do I have to create the UIViewController for this simple one-view app?
Let's extend that to a two-UIView app case. In this case, I have an app with two views, one of which is totally custom with no widgets (drawRect here I come) and the other view is widget-tastic (settings, etc.). I want to be able to swap the views, one of which I've created in IB and the other which is pure code. I'm creating the custom-painted UIView as follows:
eyesView = [[EyesView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];")
In the case of the widget view, I'm using:
settingsView = (SettingsView *)[[[UIViewController alloc] initWithNibName:@"SettingsView" bundle:nil] view];
But I can't seem to figure out a way to awaken the XIB without using this dummy UIViewController which I have no use for. This brings me back to the original question - what is the purpose of the UIViewController? Is it only a nicety that Apple has included to let developers get up and running with navigation panes and their like easily (I don't imagine so)?
Is there a better way to be doing all this?
Thanks!