Porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI.

Overview

SwiftUI example app: Koober

We're porting the example app from our Advanced iOS App Architecture book from UIKit to SwiftUI and we are sharing the code in this repo.

Please feel free to follow along and/or contribute. This is an experimental codebase we're using to learn how to best architect SwiftUI apps.

Architectures

This repo holds examples for two architectures, Swift-State and MVVM. The Swift-State example is in the swift-state directory and the MVVM example is in the mvvm directory. Note: the examples are a work in progress and may not be complete.

Comments
  • SwiftUI view depending on abstract

    SwiftUI view depending on abstract

    Checklist

    Description

    Been doing some experimentation on having SwiftUI views to depend on an abstract model. The model could then be injected and have mock representations for testing.

    Pros to this approach

    • Ability to control surface area of Bindable properties
    • Extracts some responsibility away from SwiftUI view
    • SwiftUI view can now depend on an abstract type rather than concrete

    Cons

    • Binding<Value> requires a backing property; You will need a separate variable to hold the state of the Binding:
    var _email = ""
    var email: Binding<String> { return .init(getValue: {  self._email }, setValue: { self._email = $0 }) }
    
    • Unable to harness the power of property wrappers
    • Compiler complains if you try to use a struct type that exposes a Binding (binding requires a way to mutate some backing property, which violates the value semantics of the struct)

    Asking for opinions on whether this is a good idea or not. Relevant thread with some opinions from Joe Groff: https://forums.swift.org/t/state-messing-with-initializer-flow/25276/8

    opened by kelvinlauKL 1
  • Starts building out new ride map view.

    Starts building out new ride map view.

    Checklist

    Description

    Adds contents into NewRideView. Adds red placeholder for map view. Adds 'Where to?' button. Adds profile image (which will be a button) to the top right using an SF symbol.

    opened by RCacheaux 0
  • Adds 'Finding your location.' view.

    Adds 'Finding your location.' view.

    Checklist

    Description

    Adds indicator view to display when finding user's current geographic location.

    opened by RCacheaux 0
  • Uses view types to capture fixed scope values such as user session.

    Uses view types to capture fixed scope values such as user session.

    Checklist

    Description

    Views that exist within scopes that come and go (such as authenticated user scope) can capture their fixed scope as property values rather than reaching through the app's state. Reaching through the app's state requires dealing with optionals and leads to force unwrapping values. This PR adds constant value properties on views to capture scoped state values.

    opened by RCacheaux 0
  • Improves layout of onboarding screens.

    Improves layout of onboarding screens.

    Checklist

    Description

    Cleans up view hierarchies for onboarding screens. Decomposes components into individual views and improves visual layout.

    opened by RCacheaux 0
  • User and auth

    User and auth

    Checklist

    Description

    Adds user and user auth models to thread information such as user profile and auth token information through the app. Adds user display name to new ride screen.

    opened by RCacheaux 0
  • Adds root dependency container.

    Adds root dependency container.

    Checklist

    Description

    Adds root dependency container to remove dependency resolution from the Koober state store.

    opened by RCacheaux 0
  • Views for iPhone X

    Views for iPhone X

    Brief

    The app has non-optimal iPhone X layout, as depicted in the screenshot in #17

    Just ran into a tip in the "Building Custom Views with SwiftUI" WWDC talk that should alleviate this:

    .edgesIgnoringSafeArea(:)

    opened by kelvinlauKL 2
Owner
raywenderlich
raywenderlich
A cooking book provides recipes to perform certain action on SwiftUI

SwiftUI Recipes This is like a cooking book. provides recipes to perform certain action on SwiftUI Every Project will contain as many SwiftUI views as

Julio Ismael Robles 2 Nov 23, 2021
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
Phone book app

Phone book app

Igor Kapustin 2 Sep 28, 2021
Mvi Architecture for SwiftUI Apps. MVI is a unidirectional data flow architecture.

Mvi-SwiftUI If you like to read this on Medium , you can find it here MVI Architecture for SwiftUI Apps MVI Architecture Model-View-Intent (MVI) is a

null 12 Dec 7, 2022
Aplikasi iOS Advanced Level To Do List dengan Firebase Auth, SwiftUI, MVVM Design Pattern, dan Firebase Firestore

Aplikasi Tasker adalah aplikasi iOS To Do List yang dibuat menggunakan Autentikasi Firebase / Firestore dan MVVM Design Pattern.

DK 10 Oct 17, 2022
Vector editor to showcase advanced scroll view and SwiftUI

ShapeEdit ShapeEdit is a showcase for Advanced ScrollView, inspired by WWDC sample with the same name. ShapeEdit is build in SwiftUI, with exception o

Dmytro Anokhin 34 Dec 29, 2022
Assignment 2 - A fully functional example in the CardinalKit-Example directory

Assignment 2 - A fully functional example in the CardinalKit-Example directory

GaitMate 1 Jan 31, 2022
Weather-swiftui - An example of using SwiftUI

weather-swiftui An example of using SwiftUI Installation Get openweather api key

null 0 Jan 1, 2022
Matthew Asaminew 0 Jan 25, 2022
Swiftui-pressed-states-example - Examples of Pressed States in SwiftUI

Examples of Pressed States in SwiftUI pressed-states.mp4

Philip Davis 6 Nov 15, 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
SwiftUI iOS Widget and WatchOS app that randomly shows a word of the day with description and example.

Word Of The Day iOS Widget and WatchOS app made in SwiftUI that displays a random word of the day with description and example of usuage. Requirements

Kyle Dold 53 Nov 29, 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
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
🖼 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

Yasuhiro Inami 160 Oct 17, 2022
SwiftUI sample app using Clean Architecture. Examples of working with CoreData persistence, networking, dependency injection, unit testing, and more.

Articles related to this project Clean Architecture for SwiftUI Programmatic navigation in SwiftUI project Separation of Concerns in Software Design C

Alexey Naumov 4k Jan 8, 2023
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

Sameer Nawaz 113 Dec 20, 2022
This is a mastodon sample SwiftUI app implemented with the architecture of state management with normalized cache.

MastodonNormalizedCacheSample This is a mastodon sample SwiftUI app. This app is implemented with the architecture of state management with Normalized

null 5 Nov 27, 2022