Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/joreilly/confettiswiftuispm
- Owner: joreilly
- License: apache-2.0
- Created: 2023-06-16T15:38:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-06T18:12:49.000Z (10 months ago)
- Last Synced: 2024-04-06T19:26:16.846Z (10 months ago)
- Topics: apollographql, kmm, swift, swift-package-manager, swiftui
- Language: Swift
- Homepage:
- Size: 24.4 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`)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()
}
}
}
```