Open-source project
kudoleh/iOS-Clean-Architecture-MVVM avatar
kudoleh/iOS-Clean-Architecture-MVVM

kudoleh/iOS-Clean-Architecture-MVVM: three layers, one ViewModel, two UIs

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

4,418 stars729 forksSwiftLicense varies

At a glance

What is it?
A Swift template that splits an iOS app into Domain, Data Repositories and Presentation layers, wires them with a DIContainer and a FlowCoordinator, and drives both a UIKit and a SwiftUI view from the same ViewModel. It is a reading template, not a framework, and it carries a fourth layer the diagram never names.
Who is it for?
Adopt it if you want to study a hand-written DI container and a flow coordinator in Swift before wiring your own product code, and skip it if your team needs a maintained dependency-injection framework or Swift Package Manager based modules.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 35 days ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • kudoleh/iOS-Clean-Architecture-MVVM4,418 ★ · +5
Star history
Repository2026-09-232026-11-13
kudoleh/iOS-Clean-Architecture-MVVM4.4k4.4k

5 Stars in the last 51 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Three layers, and a fourth hiding in the file paths

The template opens with a three-line layer split: Domain Layer holds entities, use cases and repository interfaces; Data Repositories Layer holds repository implementations plus the API and the persistence database; Presentation Layer is MVVM, made of ViewModels and views. Read the concept links, though, and a fourth name appears that the layer list never mentions. The error handling example is linked at ExampleMVVM/Infrastructure/Network/NetworkService.swift, and the unit tests are described as covering NetworkService in the Infrastructure Layer. So the shipped tree is Domain, Data, Infrastructure and Presentation, while the diagram a reader copies into a design doc shows three. That inconsistency is the first thing to resolve if you adopt the structure, because the dependency rule the README states is that the Domain Layer should include nothing from any other layer, and it names Presentation and Data layer Codable mapping as the usual leaks. A fourth layer with its own network client makes the rule harder to hold, since a repository implementation that returns a domain entity still has to build it out of whatever the network service hands back.

The Domain Layer itself is the cleanest part. Use cases there take repository interfaces, not concrete repositories, so nothing in the domain knows whether a result came from the network or from the cache.

AppDIContainer and the FlowCoordinator that owns navigation

Wiring happens in one file, ExampleMVVM/Application/DIContainer/AppDIContainer.swift, and navigation in ExampleMVVM/Presentation/MoviesScene/Flows/MoviesSearchFlowCoordinator.swift. The container builds the repositories, the use cases and the view models, then hands them to whoever needs them. The coordinator owns the sequence instead of letting views push each other, which is why the search screen can exist as both a UIKit controller and a SwiftUI view: the same MoviesQueryListViewModel is constructed either way, and the coordinator starts the same flow for either presentation.

That reuse is the template's most useful single idea, and it is narrower than the README's framing makes it sound. Data binding is an Observable type written at ExampleMVVM/Presentation/Utils/Observable.swift, with no third party library, so a view subscribes to the ViewModel's published state and updates. There is no Combine chain, no property wrapper layer beyond what that file provides, and no mention of SwiftUI's native Observation. Fine for a template. Less fine as an argument for shipping that data binding layer in a real app, where Combine or the Observation framework may already be in the toolchain.

Replacing the Movie item name, and what the app does on first run

The README states the app can serve as a template by replacing the item name Movie. There is no install command anywhere in it, no package manager setup, and no pod or Carthage step. You get the project by opening ExampleMVVM.xcodeproj from a clone in Xcode 14 or later with Swift 5.7 or later, and the repository already contains both MVVM Local Swift Packages.zip and MVVM Modular Layers Pods.zip.

On first run the app is a movie search screen. You type a name into the search bar, hit search, and two network calls fire: one for movies, one for poster images. Every successful search query is stored persistently. The Response Data Caching concept points at DefaultMoviesRepository.swift. That is the whole product: one searchable list, a detail view built with size classes and UIStackView, dark mode, and pagination. Tests cover the use cases, the ViewModels and the network service, and there is a UI test target alongside them.

DTOs keep Codable out of the domain, and the mapper pays for it

The response DTO and its mapping live together in ExampleMVVM/Data/Network/DataMapping/MoviesResponseDTO+Mapping.swift, which is the concrete enforcement of the README's rule against Codable in the domain. A DTO carries the decoder's view of the payload, and the mapping file turns it into the entity the use cases hand upward. Separate the two and you get a boundary you can test without a decoder.

The cost is a file per response shape, and a second place to update whenever a payload field changes. For an app with two network calls, as here, that is cheap. For an app with dozens of endpoints, the mapping layer becomes the place where drift hides, and nothing in the project automates it.

Storyboards, then a second repository without them

This repository builds its views in Storyboards, with one exception written in SwiftUI. The author is explicit that the same choice exists elsewhere: iOS-Clean-Architecture-MVVM-Views-In-Code skips Storyboards entirely and uses UITableViewDiffableDataSource. That sibling is the real alternative to this template, and the difference is approach rather than feature. Both split the same layers and both reuse a ViewModel; one keeps Interface Builder in the build and lays out views in Storyboards, the other constructs views in Swift and leans on diffable data sources for list updates. Choose the Storyboards version if your team still maintains Storyboards and wants a template that matches that habit. Choose the Views-In-Code version if you want no Interface Builder file to open and list animations handled by the framework rather than by reload calls.

Networking has a similar extraction path: the author publishes the networking code separately as SENetworking, so the network client is the piece meant to leave this template first.

Where the Travis CI and Fastlane pipeline sits

The build configuration is a .travis.yml alongside a Gemfile and Gemfile.lock, which dates the project to a CI era that Xcode developers have largely moved past; no GitHub Actions workflow appears at the repository root. The last push was on 2026-10-11, and the repository has no GitHub releases. The README does not state a licence, and it does not document how to upgrade the template or how to migrate it onto current Swift concurrency, so anyone lifting it inherits an unanswered licensing question and an unstated migration path.

Those gaps matter more for a template than for a library. A library's users pin a version; a template's users copy the code, and what they copy is only as current as the last commit.

Where the seams show when you build on it

Two failure modes are visible in the layout itself. First, the coordinator and the DIContainer are hand written for one feature, the movies scene, so a second feature means writing a second flow and registering more objects in the container by hand; there is no scope object, no property wrapper and no generated graph. Second, caching lives inside DefaultMoviesRepository, so a cache policy decision is made in the same file as the network call and cannot be swapped for a fake in tests without touching the same type.

Neither is a defect for a template. Both are the reason to read it and write your own rather than fork it and build a product on top.

Editorial conclusion

Adopt it if you want to study a hand-written DI container and a flow coordinator in Swift before wiring your own product code, and skip it if your team needs a maintained dependency-injection framework or Swift Package Manager based modules. Check first whether the movies search feature maps cleanly onto your own screen: every screen in this template starts at MoviesSearchFlowCoordinator, so if your app boots into a signed-in tab bar instead, the flow you would delete is the flow you needed. The detail screen is the second place to check, since it is laid out with size classes and UIStackView rather than in SwiftUI.

Frequently asked questions

What is the difference between MVVM and Clean Architecture in this template?

MVVM is used here for the Presentation Layer, meaning ViewModels plus views, while Clean Architecture is the wider three-part split into Domain, Data Repositories and Presentation. The ViewModel is one layer inside the larger structure, not the structure itself.

Does iOS-Clean-Architecture-MVVM need any dependency manager to build?

The README gives no install command and no pod or Carthage step. It asks for Xcode 14+ and Swift 5.7+, targeting iOS 15.0+, and the repository already contains MVVM Local Swift Packages.zip and MVVM Modular Layers Pods.zip.

Can the same ViewModel drive both UIKit and SwiftUI views?

Yes. MoviesQueryListViewModel is shared by a UIKit implementation and a SwiftUI view, which is the point the README makes about the presentation layer changing only in UI. The SwiftUI view needs at least Xcode 11.

What does the app actually do when you run it?

You type a movie name into the search bar and hit search, which makes two network calls, one for movies and one for poster images. Every successful search query is stored persistently.

Is there a variant of this template that does not use Storyboards?

The author publishes iOS-Clean-Architecture-MVVM-Views-In-Code, which builds every view in code and uses UITableViewDiffableDataSource. This repository uses Storyboards, with one view written in SwiftUI.

Is iOS-Clean-Architecture-MVVM still updated?

The last push was on 2026-10-11 and the repository is not archived. It has no GitHub releases, so there is no tagged version to pin to.

Official sources

  1. Issues
  2. kudoleh/iOS-Clean-Architecture-MVVM on GitHub
  3. Project website
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kudoleh-ios-clean-architecture-mvvm.svg)](https://hysenlabs.com/projects/kudoleh-ios-clean-architecture-mvvm)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/kudoleh-ios-clean-architecture-mvvm.svg)](https://hysenlabs.com/projects/kudoleh-ios-clean-architecture-mvvm)

Was this useful?