Member-only story
SwiftUI: Choosing an Application Architecture
It’s hard to decide if you don’t know what you need.

SwiftUI’s declarative approach to software development makes it much, much easier to write modern applications for iOS, the Mac, and for the rest of Apple’s ecosystem.
But SwiftUI is not without its own challenges and questions, and one of those questions is just what sort of architecture we’re supposed use in our brand spanking new SwiftUI applications?
It’s a question frequently asked and — perhaps to no one’s surprise — one that’s frequently answered. There are, in fact many, many, many articles and books and presentations on the subject.
Unfortunately, quite a few of those are done by people eager to bring their own favorite architecture to SwiftUI. And so we’re faced with an overwhelming torrent of articles telling us why we should use MVVM, or React/Redux, or Clean, or VIPER, or TCA. Or even none at all.
I supposed I’m as guilty as anyone in that regard, given the articles I’ve written on the subject myself.
Nevertheless, the question remains: Which one should we choose?
How do we decide?
What criteria do we use to make our choice?
What criteria… indeed?
You see, with that last question, a glimmer of light begins to appear on the horizon. Maybe, just maybe, it’ll be easier to answer our architecture question if we know the answer to another question:
What problems do we want our architecture to solve?
Defining the Problem
Physicists have an old saying: time is the thing that keeps everything from happening all at once.
And since time exists, since everything doesn’t happen all at once, we as a human race decided to create a few units of measurement in order to better keep things organized.
Things like minutes and seconds. Distinct periods of time that we further aggregate and group into hours and days, months and years, and so on. Common units, a common framework we can use to discuss time. To mange it. To understand it.