The Myth of the MV pattern: Why SwiftUI developers just reinvented MVC

Since the introduction of SwiftUI, the MV pattern has been discussed in online forums about SwiftUI architecture.

Its proponents sell it as a new pattern that aligns with how SwiftUI is intended to be used, while patterns like MVVM are allegedly at odds with the framework.

In this article, I will show how the MV pattern is just a rehash of MVC, and ideological adherence to this so-called new pattern only leads to violating fundamental design principles.

Why VIPER and MVVM in SwiftUI are actually the same pattern: A lesson in architectural thinking

Architectural design patterns like VIPER might seem radically different from common ones like MVVM.

However, upon deeper inspection, it turns out that these patterns share the same constitutive components.

In this article, we will compare the MVVM and VIPER design patterns in SwiftUI and show how they follow the same principles.

From broken to testable SwiftUI navigation: The decoupled approach of MVVM with coordinators

SwiftUI provides several tools for managing navigation, and the introduction of NavigationStack and value-destination links improved programmatic navigation.

However, in larger applications, vanilla SwiftUI navigation can pose challenges for testability, maintainability, and modularity. Navigation logic is distributed across views, introducing coupling and making the navigation code hard to locate.

These problems can be addressed by integrating coordinators into the MVVM pattern.

Is SwiftData incompatible with MVVM? The standard answer disregards some key principles driving SwiftUI’s architecture

Some developers claim that MVVM is incompatible with SwiftUI.

However, with a proper understanding of SwiftUI, it is possible to address any criticisms and eliminate the boilerplate code seen in many online blogs.

In this article, we will explore some fundamental yet ignored SwiftUI features to understand how to replicate its integration with SwiftData inside our view models.

Why Dismissing View Models in SwiftUI is Stifling your App’s Maintainability and Testability (And the Proven Principles for a Better Architecture)

If you’ve been working with SwiftUI, you’ve likely noticed that your views start pretty simple but then balloon into large, unmaintainable monoliths that are hard to preview and test.

While there are several techniques to keep SwiftUI views modular and reusable, some problems are architectural in nature and can only be addressed by following proven software design principles.

Particularly, view models are an essential component to guarantee testability, maintainability, and code reuse across views.

How to Create and Combine SwiftUI Views Without Getting Lost in Deep Nesting and Complex Layouts

As you create increasingly complex SwiftUI views, you may feel your code is turning into a tangled mess of nested stacks, layout view modifiers, and conditionals.

In this article, we’ll explore how to leverage SwiftUI’s full toolkit—beyond just stacks—to build configurable views. You’ll learn to use built-in specialized views, view styles, and view builders for idiomatic code that’s easier to customize.

From Massive SwiftUI Views to Reusable Components: The Root MVVM Approach to Modular Interfaces

On the Internet, you can find plenty of SwiftUI tutorials that dive straight into building user interfaces without much consideration for underlying architectural principles.

While these examples can get you started, they often lead to a common pitfall: massive SwiftUI views, i.e., views that are hundreds or even thousands of lines long, brimming with disparate logic.

In this article, I will explain why massive views are a problem and introduce a robust approach to building modular SwiftUI views that are more reusable, easier to understand, and instantly previewable in Xcode.