Skip to content

ngocpd-1250/clean_swiftui_combine

Repository files navigation

Clean Architecture using SwiftUI + Combine

The example app uses the Clean Architecture approach with SwiftUI and Combine.

Features

  • Xcodegen: Automated project configuration.
  • Clean Architecture: Separation of concerns with clear boundaries between layers.
  • SwiftUI: Declarative UI framework for building modern iOS apps.
  • Combine: Reactive framework for handling asynchronous events and data streams.
  • Dependency Injection: Easy management of dependencies and testability.
  • Unit Tests: Includes unit tests for business logic and use cases.
  • Dark Mode: Programmatically supports Dark Mode switch.
  • SwiftData: SwiftData support.

Requirements

  • Xcode 15.0+
  • Swift 5.7+
  • Homebrew installed

Installation

  1. Install Homebrew Dependencies:

    brew install xcodegen swiftlint swiftformat
  2. Clone the Repository:

    git clone git@github.com:ngocpd-1250/clean_swiftui_combine.git
    cd BaseSwiftUI
  3. Generate Xcode Project:

    Use xcodegen to generate the Xcode project:

    xcodegen
  4. Open Xcode:

    Open the generated Xcode project:

    open BaseSwiftUI.xcodeproj
  5. Build and Run:

    Build and run the project in Xcode.

Project Structure

The project follows the Clean Architecture principles with the following layers:

  • Presentation: SwiftUI views, navigators and view models.
  • Domain: Business logic and use cases.
  • Data: Data sources and repositories.

Linting

  1. Linting: SwiftLint
  2. Formatting: SwiftFormat

Packages

  1. LinkNavigator: for navigation management
  2. Factory: for dependency injection
  3. Rswift: for resource management
  4. Kingfisher: for loading and caching remote images
  5. Alamofire: for API requests

Releases

No releases published

Packages

No packages published