Skip to content

UIKit demo of Clean Architecture: MVVM, Coordinators, DI, Moya, pagination, image caching, MapKit, and unit/UI test coverage with XCTest.

License

Notifications You must be signed in to change notification settings

GorMartirosyan/Clean-MVVM-C

Repository files navigation

📱 Clean-MVVM-C

An iOS application built with UIKit, following Clean Architecture, MVVM, and Coordinators, with manual Dependency Injection.
Implements a type-safe Moya networking layer, image caching, pagination, and MapKit integration — structured for scalability, maintainability, and testability.


📌 Overview

This app fetches and displays users from the Random User API:

  1. User List – Paginated table view of users with name, email, and avatar.
  2. Image Loading & Caching – Async image loading with NSCache-based memory caching and request cancelation.
  3. Pagination – Automatic load-more when reaching the list end.
  4. User Details – Displays larger avatar, name, and map location.
  5. Coordinate Validation – Only valid coordinates are shown on the map.

This project reflects real-world architecture used in production, with clear separation of concerns, high test coverage, and easy extensibility.


🛠 Technology Stack

  • UIKit – Interface and navigation
  • MVVM – Separation of UI and business logic
  • Coordinators – Scene-based navigation orchestration
  • Manual Dependency Injection – Lightweight, explicit DI without frameworks
  • Moya – Networking layer (DTO → Domain mapping)
  • MapKit – Map rendering
  • NSCache – Image caching
  • XCTest & XCUITest – Unit, integration, and UI testing

📂 Project Structure

Clean-MVVM-C/
├── Application/        # AppDelegate, AppCoordinator, AppDIContainer
├── Presentation/       # ViewControllers, ViewModels, Coordinators
├── Domain/             # Entities, UseCases, Repository Interfaces
├── Data/               # Repository Implementations, API DTOs, Services
├── Infrastructure/     # Networking layer
├── Resources/          # Assets, Constants
├── Tests/              # Unit, Integration & UI tests

🖼 Screenshots

User List Screen User Details Screen
User List User Details

✨ Use if you want to

This project can be used as a reference or starting point if you want to:

  • Build a UIKit app with Clean Architecture separation.
  • Implement MVVM and Coordinators in a practical way.
  • Work with a type-safe Moya networking layer.
  • Apply manual dependency injection in a real project.
  • Add image caching with request cancelation.
  • Write UI, integration, and unit tests for a real app flow.

🔧 Running the App

git clone https://github.com/gormartirosyan/Clean-MVVM-C.git
cd Clean-MVVM-C
pod install
open Clean-MVVM-C.xcworkspace

Run with ⌘R.
Run tests with ⌘U.


🧑‍💻 Author

Gor Martirosyan – iOS Developer
@gormartirosyan


📄 License

Licensed under the MIT License.