Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MVI (Model-View-Intention)
Search
Kapil Rathore
February 29, 2020
Programming
1
74
MVI (Model-View-Intention)
Presented on 29 February 2020 at Swift India.
https://www.meetup.com/Swift-Delhi/events/268573479/
Kapil Rathore
February 29, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
CSC307 Lecture 09
javiergs
PRO
1
840
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
2026年 エンジニアリング自己学習法
yumechi
0
140
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
180
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
並行開発のためのコードレビュー
miyukiw
0
180
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
460
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
200
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
190
The SEO Collaboration Effect
kristinabergwall1
0
350
Unsuck your backbone
ammeep
671
58k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
4 Signs Your Business is Dying
shpigford
187
22k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Building the Perfect Custom Keyboard
takai
2
680
Transcript
Kapil Rathore iOS @ Tokopedia MVI (Model-View-Intention) Reactive Unidirectional Architecture
for your Apps @krkapilrathore @krkapilrathore @kapilrathore
What are you doing this weekend ? ♂
♂ I’m attending Swift Delhi Meetup
♂ Should I also join ?
♂ Sure, it’ll be fun !!
♂
♂ ⌨ INPUT OUTPUT OUTPUT INPUT
♂ ⌨ View ( ) User ( ) Model (
) Intention ( )
user ( )
intention ( user ( ) )
model ( intention ( user ( ) ) )
view ( model ( intention ( user ( ) )
) )
view ( model ( intention ( ) ) )
Pure Functions
Pure Functions ✅ ❌
Intention • Take the inputs from the user • Map
the user inputs to Model friendly events • Eg - button click events, text input events etc.
Model • Take the inputs from Intention • Processes a
particular business Usecase based on the input • Produces a New State as an output • Only piece of code that is allowed to change the State
• Immutable data structure • Holds all the important information
required to change the dynamic data on the UI layer • Acts as the single source of truth State
• Takes the output State produced by the Model as
input • Contains the rendering logic for the emitted state View
Rx Operators that we are going to use
Observable Sequence
None
None
None
Talk is cheap. Show me the code. - Linus Torvalds
Example App Counter MVI
Planning Intentions • Increment • Decrement • Reset Counter •
Interval Change
Code Intentions
Planning State • Count Value • Interval
Code State
Planning Model Usecases • Increment Usecase • Decrement Usecase •
Reset Counter Usecase • Interval Change Usecase
Code Increment Usecase
Code State
Code Decrement Usecase
Code Reset Counter Usecase
Code Interval Change Usecase
Intention View Different Model Usecases
BIND function - Model
Code View
Glue Code Outlets
Glue Code Initialize MVI Components
Glue Code Binding the MVI Components
Glue Code Implement the View Layer
Live Preview in Simulator
Summary Pros • Unidirectional & Cyclic Flow of Data •
Decoupled Code • Predictable (Pure functions + Immutable States) • Highly Testable & Debuggable (Encourages TDD) • User Centric (User drives the architecture) • Reactive (Handles the async code) • Platform Agnostic (Cross platform collaboration)
Summary Cons • Lots of Boilerplate • Where to place
navigation logic • Complexity (Learning Curve)
What’s Next + Combine Cook MVI using SwiftUI and Combine
References • What if the user was a function? by
Andre Staltz at JSConf Budapest 2015 • Managing State with RxJava by Jake Wharton • Mobius by Spotify • MVI Series: A Pragmatic Reactive Architecture for Android
Kapil Rathore iOS @ Tokopedia Questions @krkapilrathore @krkapilrathore @kapilrathore
Kapil Rathore iOS @ Tokopedia Thank You @krkapilrathore @krkapilrathore @kapilrathore