SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築
ichikaway
 
ロボットアームをPythonで動かす
ロボットアームをPythonで動かすロボットアームをPythonで動かす
ロボットアームをPythonで動かす
Core Concept Technologies
 
FA技術者のためのFABスペースの検討() .pptx
FA技術者のためのFABスペースの検討() .pptxFA技術者のためのFABスペースの検討() .pptx
FA技術者のためのFABスペースの検討() .pptx
Tomoya Takahashi
 
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
Recruit Lifestyle Co., Ltd.
 
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作るSpring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作る
Go Miyasaka
 
Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門
tsukasamannen
 
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
Recruit Lifestyle Co., Ltd.
 
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
Masamitsu Maehara
 
SharePoint Online 外部共有を考える
SharePoint Online 外部共有を考えるSharePoint Online 外部共有を考える
SharePoint Online 外部共有を考える
Teruchika Yamada
 
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
Fumiya Sakai
 
Elasticsearch勉強会#44 20210624
Elasticsearch勉強会#44 20210624Elasticsearch勉強会#44 20210624
Elasticsearch勉強会#44 20210624
Tetsuya Sodo
 
Azure API Management 俺的マニュアル
Azure API Management 俺的マニュアルAzure API Management 俺的マニュアル
Azure API Management 俺的マニュアル
貴志 上坂
 
Cache-Oblivious データ構造入門 @DSIRNLP#5
Cache-Oblivious データ構造入門 @DSIRNLP#5Cache-Oblivious データ構造入門 @DSIRNLP#5
Cache-Oblivious データ構造入門 @DSIRNLP#5
Takuya Akiba
 
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
拓将 平林
 
ZOZOTOWNのアーキテクトという役割を紹介します
ZOZOTOWNのアーキテクトという役割を紹介しますZOZOTOWNのアーキテクトという役割を紹介します
ZOZOTOWNのアーキテクトという役割を紹介します
Hiromasa Oka
 
シングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のりシングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のり
Shinichi Tomita
 
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
株式会社MonotaRO Tech Team
 
LTのネタLT
LTのネタLTLTのネタLT
LTのネタLT
XMLProJ2014
 
イベント・ソーシングを知る
イベント・ソーシングを知るイベント・ソーシングを知る
イベント・ソーシングを知る
Shuhei Fujita
 
UIPageViewControllerとContainerViewでこんな見た目を実現するTips
UIPageViewControllerとContainerViewでこんな見た目を実現するTipsUIPageViewControllerとContainerViewでこんな見た目を実現するTips
UIPageViewControllerとContainerViewでこんな見た目を実現するTips
Fumiya Sakai
 
Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築Nginxを使ったオレオレCDNの構築
Nginxを使ったオレオレCDNの構築
ichikaway
 
FA技術者のためのFABスペースの検討() .pptx
FA技術者のためのFABスペースの検討() .pptxFA技術者のためのFABスペースの検討() .pptx
FA技術者のためのFABスペースの検討() .pptx
Tomoya Takahashi
 
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
自動化を支えるCI/CDツールの私の選択 ~何をするためにCI/CDツールを選ぶか~
Recruit Lifestyle Co., Ltd.
 
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作るSpring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作る
Go Miyasaka
 
Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門Spring Boot ユーザの方のための Quarkus 入門
Spring Boot ユーザの方のための Quarkus 入門
tsukasamannen
 
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
CTIサービスを支える裏側 〜物理デバイスとの戦い〜 | iOSDC Japan 2020
Recruit Lifestyle Co., Ltd.
 
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
Masamitsu Maehara
 
SharePoint Online 外部共有を考える
SharePoint Online 外部共有を考えるSharePoint Online 外部共有を考える
SharePoint Online 外部共有を考える
Teruchika Yamada
 
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
既存プロジェクトで使っていたDIをお引っ越し&DIYすることになった
Fumiya Sakai
 
Elasticsearch勉強会#44 20210624
Elasticsearch勉強会#44 20210624Elasticsearch勉強会#44 20210624
Elasticsearch勉強会#44 20210624
Tetsuya Sodo
 
Azure API Management 俺的マニュアル
Azure API Management 俺的マニュアルAzure API Management 俺的マニュアル
Azure API Management 俺的マニュアル
貴志 上坂
 
Cache-Oblivious データ構造入門 @DSIRNLP#5
Cache-Oblivious データ構造入門 @DSIRNLP#5Cache-Oblivious データ構造入門 @DSIRNLP#5
Cache-Oblivious データ構造入門 @DSIRNLP#5
Takuya Akiba
 
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
サーバーレスWebアプリケーションを作ろう~AWSと比べてみる~
拓将 平林
 
ZOZOTOWNのアーキテクトという役割を紹介します
ZOZOTOWNのアーキテクトという役割を紹介しますZOZOTOWNのアーキテクトという役割を紹介します
ZOZOTOWNのアーキテクトという役割を紹介します
Hiromasa Oka
 
シングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のりシングルサインオンの歴史とSAMLへの道のり
シングルサインオンの歴史とSAMLへの道のり
Shinichi Tomita
 
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
[ITmedia Cloud Native 2023] モノタロウのクラウドネイティブ.pdf
株式会社MonotaRO Tech Team
 
イベント・ソーシングを知る
イベント・ソーシングを知るイベント・ソーシングを知る
イベント・ソーシングを知る
Shuhei Fujita
 
UIPageViewControllerとContainerViewでこんな見た目を実現するTips
UIPageViewControllerとContainerViewでこんな見た目を実現するTipsUIPageViewControllerとContainerViewでこんな見た目を実現するTips
UIPageViewControllerとContainerViewでこんな見た目を実現するTips
Fumiya Sakai
 

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

Knockout js
Knockout jsKnockout js
Knockout js
Dr. Awase Khirni Syed
 
MVVM and Prism
MVVM and PrismMVVM and Prism
MVVM and Prism
Bilal Ahmed
 
MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
Himanshu Dudhat
 
MVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive appsMVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive apps
KotiTenali
 
реалии использования Mv в i os разработке
реалии использования Mv в i os разработкереалии использования Mv в i os разработке
реалии использования Mv в i os разработке
Provectus
 
Write cleaner, maintainable, and testable code in Android with MVVM
Write cleaner, maintainable, and testable code in Android with MVVMWrite cleaner, maintainable, and testable code in Android with MVVM
Write cleaner, maintainable, and testable code in Android with MVVM
Adil Mughal
 
iOS architecture patterns
iOS architecture patternsiOS architecture patterns
iOS architecture patterns
allanh0526
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
Tech_MX
 
MVVM presentation
MVVM presentationMVVM presentation
MVVM presentation
Inova LLC
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
Qamar Abbas
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
Betclic Everest Group Tech Team
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
Boulos Dib
 
software architecture
software architecturesoftware architecture
software architecture
arnav gupta
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVM
Andrei Popa
 
MVVM in iOS presentation
MVVM in iOS presentationMVVM in iOS presentation
MVVM in iOS presentation
G ABHISEK
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural components
Muhammad Ali
 
iOS Coding Best Practices
iOS Coding Best PracticesiOS Coding Best Practices
iOS Coding Best Practices
Jean-Luc David
 
Mvvm
MvvmMvvm
Mvvm
Rajeev Ranjan Singh
 
VIPER Architecture
VIPER ArchitectureVIPER Architecture
VIPER Architecture
Ahmed Lotfy
 
Adopting MVVM
Adopting MVVMAdopting MVVM
Adopting MVVM
John Cumming
 
MVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive appsMVC architecture in software programming for interactive apps
MVC architecture in software programming for interactive apps
KotiTenali
 
реалии использования Mv в i os разработке
реалии использования Mv в i os разработкереалии использования Mv в i os разработке
реалии использования Mv в i os разработке
Provectus
 
Write cleaner, maintainable, and testable code in Android with MVVM
Write cleaner, maintainable, and testable code in Android with MVVMWrite cleaner, maintainable, and testable code in Android with MVVM
Write cleaner, maintainable, and testable code in Android with MVVM
Adil Mughal
 
iOS architecture patterns
iOS architecture patternsiOS architecture patterns
iOS architecture patterns
allanh0526
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
Tech_MX
 
MVVM presentation
MVVM presentationMVVM presentation
MVVM presentation
Inova LLC
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
Qamar Abbas
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
Boulos Dib
 
software architecture
software architecturesoftware architecture
software architecture
arnav gupta
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVM
Andrei Popa
 
MVVM in iOS presentation
MVVM in iOS presentationMVVM in iOS presentation
MVVM in iOS presentation
G ABHISEK
 
Android architectural components
Android architectural componentsAndroid architectural components
Android architectural components
Muhammad Ali
 
iOS Coding Best Practices
iOS Coding Best PracticesiOS Coding Best Practices
iOS Coding Best Practices
Jean-Luc David
 
VIPER Architecture
VIPER ArchitectureVIPER Architecture
VIPER Architecture
Ahmed Lotfy
 
Ad

More from MobileMonday Estonia (20)

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

Recently uploaded (20)

Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 

"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