IgnacioGalliano / ios-MVVM-SwiftUI-Marvel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marvel SwiftUI App
Marvel SwiftUI App

How to run this application?

Easier way:

  1. Run the mock server
  2. Select the local scheme

local scheme

3. Run the application

Other way:

  1. Create a new account on the Marvel website
  2. Create a new MarvelMovieDB-info.plist file
  3. Add your keys "PRIVATE_KEY" / "PUBLIC_KEY"
  4. Run the application with the common scheme

local scheme

local scheme

UnitTests & UITests

To run the tests targets, you need to use an iphone 15 simulator with iOS 17.0. Why? because the snapshot tests refenrences had been done on this device and iOS version. Also you need to run the mock server and use the local scheme to assert all the UITests

Clean Architecture and MVVM

In this example we applied clean code with the three layers

Presentation layer (MVVM): contains UI (UIViewControllers or SwiftUI Views). Views are coordinated by ViewModels (Presenters) which execute one or many Use Cases. Presentation Layer depends only on the Domain Layer.

Domain layer: It contains Entities, UseCases, Errors, etc.

Data layer: Data Layer contains Repository Implementations and one or many Data Sources. Repositories are responsible for coordinating data from different Data Sources. Data Source can be Remote or Local (for example persistent database). Data Layer depends only on the Domain Layer. In this layer, we can also add mapping of Network JSON Data.

About


Languages

Language:Swift 100.0%