iew Controllers are special objects of UIViewController type or one of its subclasses. They connect the application's data and its visual appearance. Every-time the app shows something to the user, the displayed content is managed by a view controller or a group of view controllers coordinating with each other.
The "Single View Application" template from Xcode comes with a default View Controller class, which also has a .xib file associated with it.
If we have a look in the AppDelegate.m file, at the top, there is the "- (BOOL)application: didFinishLaunchingWithOptions:" method, and inside that, there is the following generated line of code (amongst others):
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
This creates a view controller object, initialising it with the "ViewController.xib" file, and then assigns it to the "viewController" property.
There are situation when we have some ViewController class, but no .xib or .storyboard file associated with it. In that case we need to replace the line above with the following line of code:
self.viewController = [[ViewController alloc] init];
and in the implementation file of our ViewController class, usually in the "- (void)viewDidLoad" method, we have to write all the UI creation and interaction code. For example:
self.view.backgroundColor = [UIColor orangeColor];