Time to Stop Using Storyboards and Start Building Programmatic UI Layouts in iOS

Michael Tier
3 min readJul 21, 2021
Photo by toma areno on Unsplash

Time is the most valuable commodity. So precious that you are unable to buy more. Once lost, it can never be replenished. As time is so precious, I am always very interested in how to do things as efficiently as possible. I am going to share an opinion that may be controversial, but I think can help an iOS learner acquire a professional iOS engineering position at a tech company much sooner in their mobile engineering journey. Here it is …

Developers new to iOS should stop using Storyboards shortly after learning the basics and consider going all-in on building your iOS UIKit Apps 100% Programmatically

Here are a few problems that one encounters when using Storyboards

Build times can increase dramatically

Having a large storyboard file can increase the compile time of your app compared to having programmatically created views. This expansion in compile time can really decrease developer efficiency. This comic from xkcd has a humorous take on compile times and efficiency.

IBAction/IBOutlet Issues

If you delete an IBOutlet or IBAction variable without using the refactor option your app will crash for no apparent reason and this crash will be hard to debug. A crash can happen with programmatic UI, but it is far easier to debug.

Nested Views

In most non-trivial apps you will have at least a few nested subviews under a view. It becomes difficult to adjust these nested subviews. On top of that, adding constraints to subviews can be very frustrating and tedious as Xcode can be finicky at times.

Hard to scale for Mobile development teams

After spending some time building a few simple iOS applications using storyboards and Interface Builder, I started to think back on my 18 years of software engineering experience working on big projects with many developers at some of the biggest tech companies like AutoDesk, IBM, and Oracle and started to question whether Storyboard development could be effectively scaled to larger developments teams. The main issue I see is that since Storyboards are a complicated human nonreadable XML file, it makes it hard to collaborate between 2 or more developers working on the same project. I have worked on tech stacks that use a lot of XML and, resolving merge conflicts in large XML files was not fun. Dealing with programmatic UI is going to be much easier for bigger fast-moving mobile development teams.

Storyboards, some love them, some don’t. While Storyboards are an easy way to create some basic apps and do quick prototyping using storyboards, the fact remains that most tech companies do not use storyboards, you might see XIBs sometimes, but for the most part, large tech companies use all programmatic layouts.

Tackling programmatic UIKit iOS development can prove to be a bit difficult but paying this cost early in your iOS development journey will pay dividends later when you go to look for work at a tech company as an iOS Engineer.

--

--