No architecture needs to have a massive view controller

Use loadView For Tiny ViewControllers

Write a fully functional ViewController in about 30 lines of code

Kenny Dubroff
Published in
6 min readJul 10, 2021

--

Small, blurry background text with the words “very tiny” magnified
Tiny ViewControllers? Very tiny

So you’re sick of massive view controllers? Me too. Many architectures attempt to overcome this problem in a way that I view as extremely complex for the problem they’re trying to solve.

I favor simple architectures and simple solutions because they’re easy to understand, develop, and maintain. For this reason, I normally start my projects using the MVC architecture. I find for most projects it strikes a great balance between complexity and abstraction. It keeps things well-separated by giving the model, view, and controller layers their own concerns.

A lot of Developers, though, complain that MVC leads to Massive View Controllers and heavily coupled code. But plenty of Swift SDKs were built using the MVC paradigm and a lot of people like Swift for its flexibility and scalability. So let’s take a look at one thing you’re probably not doing that’s not only leading to the Massive View Controller moniker but is also breaking the spirit of MVC.

Separate Your View From Your Controller

--

--

Kenny Dubroff
Geek Culture

I’m a Full Stack iOS Developer with a passion for writing clean, reusable code.