Member-only story

The MVI Architecture Pattern in Swift

Architect! With just RxSwift!

Steven Curtis
8 min readAug 13, 2020
Photo by KOBU Agency on Unsplash

You might already be familiar with MVVM even MVVM-C and even (jokes) MVC. But MVI? You might have heard of the Flux, Redux and MobX React patterns and you might not be aware that in native development this is actually MVI.

This article explores a sample project that uses **just** RxSwift for implementation. Wow. But the parts to make this work (while non-trivial) are not that hard…come on!

Difficulty: Beginner | Easy | Normal | Challenging

This article has been developed using Xcode 11.4.1, and Swift 5.2.2

Prerequisites:

  • Coding in Swift Playgrounds (guide HERE)
  • Some knowledge of RxSwift would be useful (guide HERE)

Terminology

MVI: Model-View-Intent

Redux: an open-source JavaScript library for managing application state

The Motivation

MVI is another architecture that looks at improving the separation of concerns when developing Apps. Those traditional patterns, MVC, MVVM and others (VIPER) are traditionally imperative. The issue is that reactive programming has become more popular, and there is nothing wrong with using RxSwift

--

--

Responses (1)