From 3aff7ba4dd7c499ca14824d9c0cc6f41077731e8 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Fri, 23 Sep 2022 00:15:20 +0200 Subject: [PATCH] Add PulseUI to example app --- Examples/xx-messenger/Package.swift | 5 +++++ .../Sources/AppFeature/AppView.swift | 11 +++++++++++ .../xcshareddata/swiftpm/Package.resolved | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/Examples/xx-messenger/Package.swift b/Examples/xx-messenger/Package.swift index 34d2f465..688d2244 100644 --- a/Examples/xx-messenger/Package.swift +++ b/Examples/xx-messenger/Package.swift @@ -58,6 +58,10 @@ let package = Package( url: "https://github.com/pointfreeco/swift-custom-dump.git", .upToNextMajor(from: "0.5.2") ), + .package( + url: "https://github.com/kean/Pulse.git", + .upToNextMajor(from: "2.1.2") + ), ], targets: [ .target( @@ -98,6 +102,7 @@ let package = Package( .target(name: "WelcomeFeature"), .product(name: "ComposableArchitecture", package: "swift-composable-architecture"), .product(name: "ComposablePresentation", package: "swift-composable-presentation"), + .product(name: "PulseUI", package: "Pulse"), .product(name: "XXMessengerClient", package: "elixxir-dapps-sdk-swift"), .product(name: "XXModels", package: "client-ios-db"), ], diff --git a/Examples/xx-messenger/Sources/AppFeature/AppView.swift b/Examples/xx-messenger/Sources/AppFeature/AppView.swift index 64a8411d..57983b1d 100644 --- a/Examples/xx-messenger/Sources/AppFeature/AppView.swift +++ b/Examples/xx-messenger/Sources/AppFeature/AppView.swift @@ -1,11 +1,13 @@ import ComposableArchitecture import HomeFeature +import PulseUI import RestoreFeature import SwiftUI import WelcomeFeature struct AppView: View { let store: Store<AppState, AppAction> + @State var isPresentingPulse = false enum ViewState: Equatable { case loading @@ -119,6 +121,15 @@ struct AppView: View { .animation(.default, value: viewStore.state) .task { viewStore.send(.start) } } + .onShake { + isPresentingPulse = true + } + .fullScreenCover(isPresented: $isPresentingPulse) { + PulseUI.MainView( + store: .shared, + onDismiss: { isPresentingPulse = false } + ) + } } } diff --git a/Examples/xx-messenger/XXMessenger.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/xx-messenger/XXMessenger.xcworkspace/xcshareddata/swiftpm/Package.resolved index 42a8b2ba..0407c096 100644 --- a/Examples/xx-messenger/XXMessenger.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/xx-messenger/XXMessenger.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -36,6 +36,15 @@ "version" : "4.2.2" } }, + { + "identity" : "pulse", + "kind" : "remoteSourceControl", + "location" : "https://github.com/kean/Pulse.git", + "state" : { + "revision" : "786611d3094e33f27d4546b260a966352bc45fd6", + "version" : "2.1.2" + } + }, { "identity" : "swift-case-paths", "kind" : "remoteSourceControl", @@ -90,6 +99,15 @@ "version" : "0.4.1" } }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c", + "version" : "1.4.4" + } + }, { "identity" : "xctest-dynamic-overlay", "kind" : "remoteSourceControl", -- GitLab