Hacker News new | ask | show | jobs
by mmorey 4569 days ago
A view can be a scene in a storyboard file, a xib file, or you can create your views programmatically (.m and .h).

A view controller is always a .m and .h.

And if you're not following the MVC pattern you can put your view code in your view controller's loadView/viewDidLoad method.

1 comments

Thanks, that's actually a helpful thing to mention and obvious in hindsight. A view controller can be the owner of a .nib but not the class of a .nib, so the .nib is never a view controller.

Are there particular divisions of responsibility that come up w.r.t. what you put in a view's .m/.h vs what you put in the controller's .m/.h? Is the .m/.h of a view considered to be a controller in the MVC sense but not in the UIViewController sense?