kudoleh/iOS-Clean-Architecture-MVVM

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

Swift

4,412

352 commits

updated Oct 11, 2026

See the code

README

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
  • Empty state with a Search button for "no query" and "no results"
  • UIScene life cycle (SceneDelegate), required for apps built with the iOS 26+ SDKs

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 enter or the search button. There are two network calls: request movies and request poster images. Every successful search query is stored persistently.

https://user-images.githubusercontent.com/6785311/236615779-153ef846-ae0b-4ce8-908a-57fca7158b9d.mp4

Requirements

  • Xcode 14+, Swift 5.7+
  • iOS 15.0+
architecture
clean-architecture
ios-swift
mvvm
mvvm-architecture
mvvm-ios
swiftui
viewmodel
viewmodels
xcode

kudoleh/iOS-Clean-Architecture-MVVM

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

Swift

4,412

352 commits

updated Oct 11, 2026

See the code

README

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
  • Empty state with a Search button for "no query" and "no results"
  • UIScene life cycle (SceneDelegate), required for apps built with the iOS 26+ SDKs

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 enter or the search button. There are two network calls: request movies and request poster images. Every successful search query is stored persistently.

https://user-images.githubusercontent.com/6785311/236615779-153ef846-ae0b-4ce8-908a-57fca7158b9d.mp4

Requirements

  • Xcode 14+, Swift 5.7+
  • iOS 15.0+
architecture
clean-architecture
ios-swift
mvvm
mvvm-architecture
mvvm-ios
swiftui
viewmodel
viewmodels
xcode

Significant stargazers

Iulian Onofrei

159 followers · starred Oct 2021

Nico Hinderling

105 followers · starred Sep 2023

Karol Piątek

14 followers · starred Jun 2022

Steffen Matthischke

43 followers · starred Dec 2019