iOS: MVVMC
MobileMonday
15 May 2017
Aleksandr Nikolajev
iOS developer
ME
• Graduated as material scientist in University of
Tartu
• Joined Mooncascade in 2015
• FinTech, transportation, multimedia, sports,
utilities
AGENDA
• Introduction to MVVMC and it’s pieces
• Some examples
• Unit testing
• Tight coupling between View and Controller
• Hard to test interactions between View and
Controller
• Model can be testable
THE PROBLEM WITH
APPLE’s MVC
• An architecture pattern
• Model - View - ViewModel - Coordinator
• MVVMC treats UIViewController as a dumb
presenter - just a view
WHAT IS MVVMC ?
HOW IT WORKS ?
• Coordinator - owns View and/or another Coordinator(s), notifies Coordinator(s)
• View - owns ViewModel, notifies ViewModel (e.g button tap)
• ViewModel - owns Model, updates View, notifies Coordinator
Model
• Usually a protocol
• C.R.U.D - Create, Read, Update, Delete
• Uses functions, NOT properties
• Injected into ViewModel
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
ViewModel
• Usually a class
• Independent of UIKit
• Injected into View and has no idea what the View is
• Business logic
• Operate with Model
• Provide presentation data to view and notify if that data has
changed
• Communicate states to Coordinator
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
Coordinator
• Declared as a protocol
• Handle navigation
• Create View and inject ViewModel into it
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
COMPLEX FLOWS
• Many UIViewControllers
• Many options to choose where to go
• Does the UIViewController has to know what to
show next?
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
View
• UIViewController is also a View !!!
• Present human readable data
• Do the layout
• Inform ViewModel about interactions
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
NOT ONLY UIViewController
• There is no rule about using ViewModels only
with UIViewController
• You can use ViewModels on almost on every UI
element
• UITextField, UIButton, …
NOT ONLY UIViewController
• This will decrease your code lines in ViewModel
• Makes code more distributed and increases
reusability
• Adds more flexibility to write unit tests
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
HOW IT COMES
TOGETHER?
• The GOD — AppCoordinator
• Only AppDelegate knows about AppCoordinator
• Desides what to show when app is finished
launching
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
UNIT TESTING
• ViewModel gets notified about events happened
in the view - we can test what is the result
• Test if presentation data is formatted correctly (e.g
convert Date object into formatted date string)
• Test if correct delegate method is called when it’s
needed to move on with the flow
• Test if errors are shown to view
• Well distributed code
• Good testability
• Easy of use
THE PROFIT
• MVVM-C A simple way to navigate

http://tech.trivago.com/2016/08/26/mvvm-c-a-
simple-way-to-navigate
• iOS Architecture Patterns

https://medium.com/ios-os-x-development/ios-
architecture-patterns-ecba4c38de52
REFERENCES
THANK YOU!
If you wish to play with the code, clone this
repo
https://github.com/sasnik/MoMoMVVMC

More Related Content

PPTX
INDIGENIZING THE SOCIAL SCIENCES.pptx
PPTX
Goals and scope of social
PPTX
3Institutionalism.pptx
DOCX
DLL-DIASS-Week 9.docx
PPTX
Hermeneutic-Phenomenology.pptx
PPTX
DISS - Module 12.pptx
PPTX
module 9 ppt diss.pptx
PPTX
Lesson 1 in Discipine and Ideas in Applied Social Sciences(lessons and activi...
INDIGENIZING THE SOCIAL SCIENCES.pptx
Goals and scope of social
3Institutionalism.pptx
DLL-DIASS-Week 9.docx
Hermeneutic-Phenomenology.pptx
DISS - Module 12.pptx
module 9 ppt diss.pptx
Lesson 1 in Discipine and Ideas in Applied Social Sciences(lessons and activi...

What's hot (20)

PPTX
Fort san pedro, cebu city
PPTX
DISS PPT.pptx
PPTX
Structural-functionalism-W5.pptx
PDF
1.1 Community Engagement, Solidarity, and Citizenship (CSC) - Compendium of A...
PPTX
week 3. disciplines and ideas in the applied social sciences
PPTX
The Human Person
PPTX
Reform Movements During the Spanish Colonization
PPTX
Discipline and Ideas in the Social Sciences
DOCX
Procedia s+bs template_wces_2013 (new)
PDF
3. Disciplines and Ideas in the Social DLP (2).pdf
PDF
FREEDOM OF THE HUMAN PERSON
PPTX
Methods of philosophizing
PPTX
Community Engagement.pptx
PPTX
LEGAL BASES OF SOCIAL WORK IN THE PHILIPPINES.pptx
PPTX
Emergence-of-the-social-science-disciplines-W4.pptx
PPTX
4 Roles, Functions and Competencies of Social Workers.pptx
PPTX
Vatican ii
PPTX
LESSON 2 DISCIPLINE AND IDEAS IN SOCIAL SCIENCE.pptx
PPTX
ARALIN 1 BATAS-RIZAL-R.A.-1425.pptx
PDF
CESC Module 1.pdf
Fort san pedro, cebu city
DISS PPT.pptx
Structural-functionalism-W5.pptx
1.1 Community Engagement, Solidarity, and Citizenship (CSC) - Compendium of A...
week 3. disciplines and ideas in the applied social sciences
The Human Person
Reform Movements During the Spanish Colonization
Discipline and Ideas in the Social Sciences
Procedia s+bs template_wces_2013 (new)
3. Disciplines and Ideas in the Social DLP (2).pdf
FREEDOM OF THE HUMAN PERSON
Methods of philosophizing
Community Engagement.pptx
LEGAL BASES OF SOCIAL WORK IN THE PHILIPPINES.pptx
Emergence-of-the-social-science-disciplines-W4.pptx
4 Roles, Functions and Competencies of Social Workers.pptx
Vatican ii
LESSON 2 DISCIPLINE AND IDEAS IN SOCIAL SCIENCE.pptx
ARALIN 1 BATAS-RIZAL-R.A.-1425.pptx
CESC Module 1.pdf
Ad

Similar to "iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade (20)

PDF
Ui design patterns
PDF
iOS architecture patterns
PDF
Models used in iOS programming, with a focus on MVVM
PPTX
iOS design patterns: MVC, MVP and MVVM
PDF
MVVM-C vs MVP
PDF
Session 7 - Overview of the iOS7 app development architecture
PDF
[@NaukriEngineering] MVVM in iOS
PDF
Introduction of Xcode
PPTX
MVx patterns in iOS (MVC, MVP, MVVM)
PDF
How I Accidentally Discovered MVVM
PDF
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
PPTX
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
PPTX
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
PDF
Android Architectures
PDF
iOS (7) Workshop
PDF
Task 2 - Educational Article – Model View Controller (MVC)
PPTX
Mobile architecture problems and solutions.
PDF
Алексей Демедецкий: How to: RAC, TDD, MVVM
PPTX
Introduce MVVM & How to implement it in your iOS app
Ui design patterns
iOS architecture patterns
Models used in iOS programming, with a focus on MVVM
iOS design patterns: MVC, MVP and MVVM
MVVM-C vs MVP
Session 7 - Overview of the iOS7 app development architecture
[@NaukriEngineering] MVVM in iOS
Introduction of Xcode
MVx patterns in iOS (MVC, MVP, MVVM)
How I Accidentally Discovered MVVM
Встреча №9. Будущее паттерна MVVM в iOS приложениях, Денис Лебедев
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Android Architectures
iOS (7) Workshop
Task 2 - Educational Article – Model View Controller (MVC)
Mobile architecture problems and solutions.
Алексей Демедецкий: How to: RAC, TDD, MVVM
Introduce MVVM & How to implement it in your iOS app
Ad

More from MobileMonday Estonia (20)

PPTX
Modern problems in backend engineering, Siim Kaspar Uustalu
PPTX
Modern problems in backend engineering, Marten Meikop
PPTX
Modern problems in backend engineering, Asko Tiidumaa
PPTX
Modern problems in backend engineering, Joel Mislav Kunst
PPTX
Modern problems in backend engineering, Jüri Tarkpea
PDF
Scientists meet Entrepreneurs - AI & Machine Learning, Mark Fishel, Institute...
PPTX
Scientists meet Entrepreneurs - AI & Machine Learning, Kristjan Korjus, Starship
PDF
Scientists meet Entrepreneurs - AI & Machine Learning, Peeter Piksarv, Moonca...
PPTX
Scientists meet Entrepreneurs - AI & Machine Learning, Tambet Matiisen, Unive...
PDF
Scientists meet Entrepreneurs - AI & Machine Learning, Dima Fishman, Universi...
PDF
Space Edition, Sven Lilla, ESA BIC
PPTX
Space Edition, Kadri Bussov, EST Cube
PPTX
Space Edition, Kalev Koppel, KappaZetta
PPTX
Space Edition, Dr. Ali Nadir Arslan
PPTX
Product Marketing, Kair Käsper, Pipedrive
PDF
Product Marketing, Marelle Ellen
PPTX
Product Marketing, Mattias Liivak, Fortumo
PDF
What Does it take to Develop Kickass Products?, Laura Noodapera
ODP
What Does it take to Develop Kickass Products?, Britt Maasalu
PPTX
Meeting Female Entrepreneurs in Tech, Triinu Sirge
Modern problems in backend engineering, Siim Kaspar Uustalu
Modern problems in backend engineering, Marten Meikop
Modern problems in backend engineering, Asko Tiidumaa
Modern problems in backend engineering, Joel Mislav Kunst
Modern problems in backend engineering, Jüri Tarkpea
Scientists meet Entrepreneurs - AI & Machine Learning, Mark Fishel, Institute...
Scientists meet Entrepreneurs - AI & Machine Learning, Kristjan Korjus, Starship
Scientists meet Entrepreneurs - AI & Machine Learning, Peeter Piksarv, Moonca...
Scientists meet Entrepreneurs - AI & Machine Learning, Tambet Matiisen, Unive...
Scientists meet Entrepreneurs - AI & Machine Learning, Dima Fishman, Universi...
Space Edition, Sven Lilla, ESA BIC
Space Edition, Kadri Bussov, EST Cube
Space Edition, Kalev Koppel, KappaZetta
Space Edition, Dr. Ali Nadir Arslan
Product Marketing, Kair Käsper, Pipedrive
Product Marketing, Marelle Ellen
Product Marketing, Mattias Liivak, Fortumo
What Does it take to Develop Kickass Products?, Laura Noodapera
What Does it take to Develop Kickass Products?, Britt Maasalu
Meeting Female Entrepreneurs in Tech, Triinu Sirge

Recently uploaded (20)

PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PPTX
Computer Software - Technology and Livelihood Education
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Guide to Food Delivery App Development.pdf
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Microsoft Office 365 Crack Download Free
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
Visual explanation of Dijkstra's Algorithm using Python
Tech Workshop Escape Room Tech Workshop
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
CCleaner 6.39.11548 Crack 2025 License Key
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Computer Software - Technology and Livelihood Education
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
BoxLang Dynamic AWS Lambda - Japan Edition
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Guide to Food Delivery App Development.pdf
Full-Stack Developer Courses That Actually Land You Jobs
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Microsoft Office 365 Crack Download Free
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Matchmaking for JVMs: How to Pick the Perfect GC Partner

"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade

  • 1. iOS: MVVMC MobileMonday 15 May 2017 Aleksandr Nikolajev iOS developer
  • 2. ME • Graduated as material scientist in University of Tartu • Joined Mooncascade in 2015 • FinTech, transportation, multimedia, sports, utilities
  • 3. AGENDA • Introduction to MVVMC and it’s pieces • Some examples • Unit testing
  • 4. • Tight coupling between View and Controller • Hard to test interactions between View and Controller • Model can be testable THE PROBLEM WITH APPLE’s MVC
  • 5. • An architecture pattern • Model - View - ViewModel - Coordinator • MVVMC treats UIViewController as a dumb presenter - just a view WHAT IS MVVMC ?
  • 6. HOW IT WORKS ? • Coordinator - owns View and/or another Coordinator(s), notifies Coordinator(s) • View - owns ViewModel, notifies ViewModel (e.g button tap) • ViewModel - owns Model, updates View, notifies Coordinator
  • 7. Model • Usually a protocol • C.R.U.D - Create, Read, Update, Delete • Uses functions, NOT properties • Injected into ViewModel
  • 9. ViewModel • Usually a class • Independent of UIKit • Injected into View and has no idea what the View is • Business logic • Operate with Model • Provide presentation data to view and notify if that data has changed • Communicate states to Coordinator
  • 11. Coordinator • Declared as a protocol • Handle navigation • Create View and inject ViewModel into it
  • 13. COMPLEX FLOWS • Many UIViewControllers • Many options to choose where to go • Does the UIViewController has to know what to show next?
  • 16. View • UIViewController is also a View !!! • Present human readable data • Do the layout • Inform ViewModel about interactions
  • 18. NOT ONLY UIViewController • There is no rule about using ViewModels only with UIViewController • You can use ViewModels on almost on every UI element • UITextField, UIButton, …
  • 19. NOT ONLY UIViewController • This will decrease your code lines in ViewModel • Makes code more distributed and increases reusability • Adds more flexibility to write unit tests
  • 22. HOW IT COMES TOGETHER? • The GOD — AppCoordinator • Only AppDelegate knows about AppCoordinator • Desides what to show when app is finished launching
  • 25. UNIT TESTING • ViewModel gets notified about events happened in the view - we can test what is the result • Test if presentation data is formatted correctly (e.g convert Date object into formatted date string) • Test if correct delegate method is called when it’s needed to move on with the flow • Test if errors are shown to view
  • 26. • Well distributed code • Good testability • Easy of use THE PROFIT
  • 27. • MVVM-C A simple way to navigate
 http://tech.trivago.com/2016/08/26/mvvm-c-a- simple-way-to-navigate • iOS Architecture Patterns
 https://medium.com/ios-os-x-development/ios- architecture-patterns-ecba4c38de52 REFERENCES
  • 29. If you wish to play with the code, clone this repo https://github.com/sasnik/MoMoMVVMC