Skip to content

Template iOS app using Clean Architecture and MVVM. Includes DIContainer, FlowCoordinator, DTO, Response Caching and one of the views in SwiftUI

Notifications You must be signed in to change notification settings

kudoleh/iOS-Clean-Architecture-MVVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7880b4e · Sep 29, 2023
Mar 25, 2023
Sep 2, 2023
Sep 1, 2023
Mar 3, 2023
Sep 17, 2019
Jan 21, 2020
Nov 28, 2019
Jan 8, 2020
Jan 8, 2020
Jul 22, 2022
Feb 23, 2022
Dec 16, 2019
May 20, 2023

Repository files navigation

Template iOS App using Clean Architecture and MVVM

iOS Project implemented with Clean Layered Architecture and MVVM. (Can be used as Template project by replacing item name “Movie”). More information in medium post: Medium Post about Clean Architecture + MVVM

Alt text

Layers

  • Domain Layer = Entities + Use Cases + Repositories Interfaces
  • Data Repositories Layer = Repositories Implementations + API (Network) + Persistence DB
  • Presentation Layer (MVVM) = ViewModels + Views

Dependency Direction

Alt text

Note: Domain Layer should not include anything from other layers(e.g Presentation — UIKit or SwiftUI or Data Layer — Mapping Codable)

Architecture concepts used here

Includes

  • Pagination
  • Unit Tests for Use Cases(Domain Layer), ViewModels(Presentation Layer), NetworkService(Infrastructure Layer)
  • Dark Mode
  • Size Classes and UIStackView in Detail view
  • SwiftUI example, demostration that presentation layer does not change, only UI (at least Xcode 11 required)

Networking

If you would like to reuse Networking from this example project as repository I made it availabe here

Views in Code vs Storyboard

This repository uses Storyboards (except one view written in SwiftUI). There is another similar repository but instead of using Storyboards, all Views are written in Code. It also uses UITableViewDiffableDataSource: iOS-Clean-Architecture-MVVM-Views-In-Code

How to use app

To search a movie, write a name of a movie inside searchbar and hit search button. There are two network calls: request movies and request poster images. Every successful search query is stored persistently.

Demo.mp4

Requirements

  • Xcode Version 11.2.1+ Swift 5.0+

About

Template iOS app using Clean Architecture and MVVM. Includes DIContainer, FlowCoordinator, DTO, Response Caching and one of the views in SwiftUI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published