Blog

Should you ditch Storyboards for SwiftUI? That's what I did

Is leaving Storyboards for SwiftUI right? In this article, I am explaining it is. Although the framework is still immature, iOS developers should already think of making a switch. Here's why.

Last time, I was writing about SwiftUI's cons. Despite its pros like declarative syntax, live preview and adding components with drag and drop, Apple's new toolkit for building user interfaces also comes with disadvantages. Most of them, like no backward compatibility & hot reload, stem from SwiftUI's relatively young age. Then it's just a matter of time that its next iterations will bring refinements of its features.

Building views without Storyboards

Recently, I've watched the Let's build this app channel on YouTube. The way Brian Voong builds applications got my attention:

  • No Storyboards,
  • No XIBs,
  • Just pure code.

Pure code, you may be asking. Yes, Voong's solutions are easy, crystal clear and, in my opinion, more efficient.

This helped me leave Storyboards behind and start writing views programmatically, on my own. Currently, I have been using this method in a chat application for clients, containing form options. When I wanted to add dynamic UITableView with custom cells, I was amazed how easy it was to prepare them with pure code.

Results of writing views programmatically:

  • Clearer code,
  • It's easier to implement global changes.

Need an example? Last time, I needed to change all fonts in one of my projects. So far, doing things like these in Storyboards was a pain in the neck. With views generated programmatically - easy peasy. Same if I want to reuse some views. No way to avoid problems when doing this in Storyboards.

Will SwiftUi win over Storyboards?

This is why I started to think about moving my projects to SwiftUI lately.

Sure, it's still not mature, and iOS 13 is the only iOS that supports it. But I'm also pretty sure that next year the situation will look different.

Apart from that, new tools are showing that help us move Storyboards projects to SwiftUI. Take the Objective2Swift converter for example. While as far as I've checked, it is not 100% trouble-free, it’s still a great way to start updating your app. In the next weeks I’m going to test it more thoroughly.

Wrapping up

Although it's still a bit early for many existing projects to jump on the SwiftUI bandwagon, more opportunities are appearing. And I think this is just the beginning. I’m sure SwiftUI will get more functions this year - Apple is going to push to make it more accessible and eventually,a global approach for building views.

Check our latest product - it's based on our experience of managing over 50-people strong company. The tool we're missing as a small company and not an enterprise.

humadroid.io is an employee and performance management software. It's an unique tool allowing everyone to be in the loop - by having up to date info about co-workers, time-off, benefits, assets, helping with one-on-ones, being a go-to place for company-wide announcements.

Check out humadroid.io
Top

Contact us

* Required fields

The controller of your personal data provided via this contact form is Prograils sp. z o.o., with a registered seat at Sczanieckiej 9A/10, 60-215 Poznań. Your personal data will be processed in order to respond to your inquiries and for our marketing purposes (e.g. when you ask us for our post-development, maintenance or ad hoc engagements for your app). You have the rights to: access your personal data, rectify or erase your personal data, restrict the processing of your personal data, data portability and to object to the processing of your personal data. Learn more.

Notice

We do not track you online. We use only session cookies and anonymous identifiers for the purposes specified in the cookie policy. No third-party trackers.

I understand
Elo Mordo!Elo Mordo!