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

Overview

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. However, this project has view model layer to make it testable as much as possible.
This idea can be achieved by Flux or Redux as well, but I chose MVVM first because it's handy.

Requirements

Xcode 11.0 Beta 5+
Swift 5.1+

More examples

See other architectures as well

You might also like...
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

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

small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api
small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api

HomeTwitter Small iOS & ipadOS application written in SwiftUI and Combine, that fetches twitter users and tweets using Twitter's api. This is just a s

SwiftUI-MSALSample - Sample project to login with MSAL using SwiftUI
SwiftUI-MSALSample - Sample project to login with MSAL using SwiftUI

SwiftUI-MSALSample I could not find a good walkthrough on how to implement MSAL

Aplikasi CrypTraces adalah MacOS Widget Crypto Tracker dengan SwiftUI, Combine & Cocoa Framework, dan WebSocket & CoinCap API
Aplikasi CrypTraces adalah MacOS Widget Crypto Tracker dengan SwiftUI, Combine & Cocoa Framework, dan WebSocket & CoinCap API

Aplikasi CrypTraces adalah MacOS Widget Crypto Tracker dengan SwiftUI, Combine & Cocoa Framework, dan WebSocket & CoinCap API. Aplikasi ini berbentuk Widget di Menu Bar MacOS dengan menampilkan beberapa Crypto Currency seperti Bitcoin (BTC), Ethereum (ETH), Dogecoin (DOGE), Monero (XMR), dan Litecoin (LTC).

An example APOD app with SwiftUI and Combine using NASA API
An example APOD app with SwiftUI and Combine using NASA API

SwiftUI-APOD An example Astronomy Picture of the Day(APOD) application using SwiftUI and Combine under iOS 13 Requirement Xcode 11 macOS 10.15 Catalin

A to-do list app using SwiftUI and combine with restful api.
A to-do list app using SwiftUI and combine with restful api.

Todo Combine SwiftUI It's an experiment project for the brand new SwiftUI + Combine + restful API with dark mode Build follow restfult to-do-api to ru

SwiftUI & Combine app using MovieDB API. With a custom Flux (Redux) implementation.
SwiftUI & Combine app using MovieDB API. With a custom Flux (Redux) implementation.

MovieSwiftUI MovieSwiftUI is an application that uses the MovieDB API and is built with SwiftUI. It demos some SwiftUI (& Combine) concepts. The goal

Demo to show Air Quality Indices of Cities (in India) using SwiftUI and Combine Framework

AirQualityMonitoring-SwiftUI-Combine Demo to show Air Quality Indices of Cities (in India) using SwiftUI and Combine Framework Demo Video City List wi

Comments
  • Overcomplicated ViewModel

    Overcomplicated ViewModel

    This is mostly a question about the code for: https://github.com/kitasuke/SwiftUI-MVVM/blob/master/SwiftUI-MVVM/ViewModels/RepositoryListViewModel.swift I see that you are organising bindings in Outputs and Inputs... in general you are adding a level of complexity that is very difficult to understand and read.

    Take as example this step in the bindingInputs() method:

        let responseStream = responsePublisher
            .share()
            .subscribe(responseSubject)
    

    and this one in the bindingOutputs() method:

        let repositoriesStream = responseSubject
            .map { $0.items }
            .assign(to: \.repositories, on: self)
    

    Why don't you just merge the two writing just:

        let responseStream = responsePublisher  // Taken from bindingInputs()
            .map { $0.items }                                      // Taken from bindingOutputs()
            .assign(to: \.repositories, on: self)         // Taken from bindingOutputs()
    

    Which is the benefit of having it done in two steps? I can't understand why putting a subject as connection between these two parts, while you could have subscribed with the .assign directly from the responsePublisher.

    (I took hours to understand what you were doing here :P )

    thank you for sharing your code! this is one of the few examples that shows a real implementation with Combine!

    opened by ariok 2
  • RepositoryListViewModel init called multiple times

    RepositoryListViewModel init called multiple times

    Firstly thank you for sharing your code, secondly i couldn't help but noticing that RepositoryListViewModel creates multiple instances at launch and a bunch of others on scrolling. is that a bug in Xcode or something else i should be aware when using swiftUI in production apps.

    opened by rmdan90 2
Owner
Yusuke Kita
Software Engineer
Yusuke Kita
Github repo search with using mvvm-c and clean architecture and using combine swift

GitSearchWithMVVM-C-CleanArchitecture Github repo search with using mvvm-c and clean architecture and using combine swift. Content Overview How To Run

Muhammad Qasim Majeed 1 Mar 16, 2022
This is an example project of SwiftUI and Combine using GitHub API.

SwiftUI-Combine-Example This is an example project of SwiftUI and Combine using GitHub GET /search/users API. ?? Requirements Swift5.1 Beta Xcode11.0

Ryo Aoyama 436 Jan 5, 2023
This is an example project of SwiftUI and Combine using GitHub API.

SwiftUI-Combine-Example This is an example project of SwiftUI and Combine using GitHub GET /search/users API. ?? Requirements Swift5.1 Beta Xcode11.0

Ryo Aoyama 435 Dec 28, 2022
An iOS template project using SwiftUI, Combine and MVVM-C software architecture

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 proje

Huy Nguyen 107 Jan 2, 2023
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

Muhammad Ewaily 3 Sep 16, 2021
Aplicación SwiftUI para visualizar datos de Github dados un usuario y un token (Github token), implementa autenticación biométrica mediante FaceID.

ios-app-swift-gitapp Aplicación SwiftUI para visualizar datos de Github dados un usuario y un token (Github token), implementa autenticación biométric

null 3 Aug 25, 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
iOS app that detects LaTeX symbols from drawings. Built using PencilKit, SwiftUI, Combine and CoreML for iOS 14 and macOS 11.

DeTeXt Finding the symbol you want to use in LaTeX can be hard since you can't memorize all the possible commands and packages for every symbol you mi

Venkat 73 Dec 8, 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