An iOS template project using SwiftUI, Combine and MVVM-C software architecture

Overview

SwiftUI-MVVM-C

A template project that uses SwiftUI for UI, Combine for event handling, MVVM-C for software architecture.

I have done some small projects using SwiftUI. It is really cool, simple and fast, but also have some thing need to be improved, that surely will be improved by Apple in the future. After that, I have been improving the project structure little by little, restructure it with the MVVM-C architecture, what I have used in most UIKit projects before. Today, I am publishing a simple project, that conclude what I have learned, used in my SwiftUI projects.

Demo

Compatibility

  • iOS 14 and later
  • SwiftUI 2 and later
  • Swift 5 and later

Project overview

The project uses the GitHub API to load a repo list of a user, show repo details when users tap on a repo. You can also tap on the top right icon to see user's profile. In this project, it is showing my repos. You can change it in the username static constant in ContentView view.

The project uses MVVM-C (aka Model - View - ViewModel - Coordinator). Why is there Coordinator here? The Coordinator is an additional part for the MVVM, that help to separate navigation handling code to a different place, instead of putting it in the View (or View Controller in UIKit). It makes the view (or view controller in UIKit) more reusable, smaller. In my SwiftUI projects, Coordinator is a View, but only for handling navigation event purpose.

What you can find in this project

  • MVVM-C implement with SwiftUI and Combine framework.
  • Networking with Combine framework, written in the way that help to test it, and integrate other 3rd parties API easily.
  • Unit test: Mock network data, view model test, dependency injection, etc.
  • Some useful extensions.
  • Structure of a SwiftUI project.

Project structure

Project structure

License

Copyright huynguyencong, Licensed under the MIT license.

You might also like...
Implemented MVVM-C (Coordinator) architecture pattern for the project. Which is satisfying SOLID principles altogether. Protocol oriented development has been followed.

BreakingBad BreakingBad API doc Implemented MVVM-C (Coordinator) architecture pattern for the project. Which is satisfying SOLID principples altogethe

RippleQueries is an iOS application built as assessment task at Ripple Egypt. Built Using MVVM (Model-View-ViewModel) and Clean Architecture concepts
RippleQueries is an iOS application built as assessment task at Ripple Egypt. Built Using MVVM (Model-View-ViewModel) and Clean Architecture concepts

RippleRepositories RippleRepositories is an iOS application built as an assessment task at Ripple Egypt. Built Using RxSwift & MVVM (Model-View-ViewMo

Demo implementing Modern MVVM with Combine and SwiftUI

ModernMVVM-Combine-SwiftUI Demo implementing Modern MVVM with Combine and SwiftUI Includes the following: Publishers feedback with needed extensions V

IOS e-commerce app developed using MVVM architecture with Swift UI
IOS e-commerce app developed using MVVM architecture with Swift UI

IOS e-commerce app developed using MVVM architecture with Swift UI.

Unidirectional reactive architecture using new Apple Combine framework
Unidirectional reactive architecture using new Apple Combine framework

Unidirectional Reactive Architecture. This is a Combine implemetation of ReactiveFeedback and RxFeedback

News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.
News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.

Box Feed News App 📱 built to demonstrate the use of following features, SwiftUI 3 Async/Await AsyncImage List Refreshable Swipe Actions Separator Cor

🖼 Gallery App for Harvest (Elm Architecture + Optics) + SwiftUI + Combine.
🖼 Gallery App for Harvest (Elm Architecture + Optics) + SwiftUI + Combine.

🖼 Harvest-SwiftUI-Gallery Gallery App for Harvest (Elm Architecture + Optics) + SwiftUI + Combine. Examples Todo List Stopwatch GitHub Search TimeTra

UDF (Unidirectional Data Flow) architecture on SwiftUI/Combine

The license The SwiftUI-UDF stays under a dual license (email confirmation required): It can be Free for non-commercial use, public repository or star

Sample iOS project built by SwiftUI + Flux and Combine framework using GitHub API
Sample iOS project built by SwiftUI + Flux and Combine framework using GitHub API

SwiftUI-Flux Flux enables us to have unidirectional data flow and make it testable. It's used to be implemented using RxSwift or ReactiveSwift in the

Owner
Huy Nguyen
I am an iOS developer. I have a few years experience in coding, planning and tech lead for company projects and pet projects.
Huy Nguyen
Best architecture for SwiftUI + CombineBest architecture for SwiftUI + Combine

Best architecture for SwiftUI + Combine The content of the presentation: First of the proposed architectures - MVP + C Second of the proposed architec

Kyrylo Triskalo 3 Sep 1, 2022
A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture.

Coinz_App_iOS A demo app to showcase testable, modern iOS development with SwiftUI and Combine on MVVM-C architecture. Tech Stack: Swift, SwiftUI, Com

Burhan Aras 0 Dec 26, 2021
Anime schedule, korean subtitle for iOS with SwiftUI + Combine and MVVM architecture

AniTime Anime schedule, korean subtitle for iOS with SwiftUI + Combine and MVVM architecture I'm developing a new one for the SwiftUI life cycle annou

Kwangmin Bae 8 Mar 14, 2022
Sample iOS project built by SwiftUI + MVVM and Combine framework using GitHub API

SwiftUI-MVVM One of the biggest idea for having MVVM is that most of data flow can be testable. Data binding in view layer by SwiftUI is awesome. Howe

Yusuke Kita 592 Jan 2, 2023
Giphy is an open source iOS app based on MVVM (Model–view–viewmodel) software architectural pattern.

Giphy(Search and display gifs) - MVVM Description Giphy is an open source iOS app based on MVVM (Model–view–viewmodel) software architectural pattern.

Tirupati Balan 8 Jun 14, 2022
SwiftUI-TodoList - This project uses MVVM architecture and UserDefaults to persist data

SwiftUI-TodoList | ├── SwiftUITodoList | ├── Library | ├── Models

Yezan Ahmed 0 Mar 9, 2022
content for Using Combine - notes on learning Combine with UIKit and SwiftUI

SwiftUI-Notes A collection of notes, project pieces, playgrounds and ideas on learning and using SwiftUI and Combine. Changes, corrections, and feedba

Joseph Heck 1.7k Dec 27, 2022
A SwiftUI Application using MVVM, Core Data and Combine

SwiftUI | Breaking Bad App Application that shows the characters of Breaking Bad.

Salvador Valverde 15 Oct 6, 2022
Mahmoud-Abdelwahab 5 Nov 23, 2022