Skip to content

YUNUSMAKAN/iOS-WeatherApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS-WeatherApp

What is MVVM Pattern?

  • The purpose of this post is to provide an introduction to the Model-View-ViewModel (MVVM) pattern. While I’ve participated in lots of discussions online about MVVM, it occurred to me that beginners who are learning the pattern have very little to go on and a lot of conflicting resources to wade through in order to try to implement it in their own code. I am not trying to introduce dogma but wanted to pull together key concepts in a single post to make it easy and straightforward to understand the value of the pattern and how it can be implemented. MVVM is really far simpler than people make it out to be.
  • MODEL
  • These hold the app data. These are the structs and classes that you have created to hold the data you receive from a REST API or from some other data source.
  • VIEW
  • These display UI elements on the screen. These are usually classes that subclass UIView and use UIKit.
  • VIEW MODELS
  • These classes are where you take the information from the model classes and transform them into values that can be displayed in a particular view.

mvvm

ScreenShot

Ekran Resmi 2020-07-18 13 54 05

Ekran Resmi 2020-07-18 13 53 50

Ekran Resmi 2020-07-18 13 02 43

Ekran Resmi 2020-07-18 13 30 57

Ekran Resmi 2020-07-18 13 16 01

Ekran Resmi 2020-07-18 13 16 30

Ekran Resmi 2020-07-18 13 16 52