Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joreilly/confettiswiftuispm

Minimal version of Confetti i0S clients that consumes shared KMM code as Swift Package
https://github.com/joreilly/confettiswiftuispm

apollographql kmm swift swift-package-manager swiftui

Last synced: 3 months ago
JSON representation

Minimal version of Confetti i0S clients that consumes shared KMM code as Swift Package

Awesome Lists containing this project

README

        

# ConfettiSwiftUISPM
Minimal version of Confetti i0S and macOS clients that consumes shared KMM code (from https://github.com/joreilly/Confetti) as a Swift Package. This uses the SwiftUI `Multiplatform App` template in XCode (supporting iOS and macOS) and uses same SwiftUI (and same package) for both. The shared code makes use of
[Decompose](https://github.com/arkivanov/Decompose) and the UI shows list of sessions for particular conference (based on
observing UI state in `SessionsComponent`)

Screenshot 2023-06-17 at 16 52 05

Following is some of the SwiftUI used

```
struct SessionsListView: View {
let component: SessionsComponent

@StateValue
private var uiState: SessionsUiState

init(_ component: SessionsComponent) {
self.component = component
_uiState = StateValue(component.uiState)
}

var body: some View {
switch uiState {
case is SessionsUiStateLoading: ProgressView()
case is SessionsUiStateError: ErrorView()
case let state as SessionsUiStateSuccess: SessionsContentView(component: component, sessionUiState: state)
default: EmptyView()
}
}
}
```