This is how I load the XIB view as subview:
UIViewController *nameController = [[NameSubViewController alloc] initWithNibName:@"NameSubViewController" bundle:nil];
UIView *subView = [nameController view];
[self.view addSubview:subView];
But then it takes up the whole screen. How can I make the subview frame size the same as the XIB? (320 x 350)
Like a CGRect 50, 50, 320, 350
Got it, had to set the size in the NameSubViewController viewDidLoad, not MainViewController init.