Posts

Showing posts with the label iOS

MVVM and MVC in swift

MVC:  View  is supposed to be inactive and only displays prepared data on demand. Model : It represents simple data. Controller   should work on the   Model   data to prepare it for the   Views , which then display that data. View  is also responsible for notifying the  Controller  about any actions, such as user touches. UIViewController  is supposed to be a  Controller  in the MVC pattern,  MVVM:  The Model View ViewModel (MVVM) is an architectural pattern used in software engineering. Models  hold application data / Content. They’re usually structs or simple classes.  Views  display visual elements and controls on the screen. They’re typically  UIView and UIViewController . xib and storyboards View models  transform model information into values that can be displayed on a view. They’re usually classes, so they can be passed around as references. ViewModel  hides all asynchronous networ...