generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from nimblehq/release/0.5.0
Release - 0.5.0
- Loading branch information
Showing
67 changed files
with
1,582 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// AppCoordinator.swift | ||
// CryptoPrices | ||
// | ||
// Created by Khanh on 19/12/2022. | ||
// | ||
|
||
import Combine | ||
import Home | ||
import MyCoin | ||
import SwiftUI | ||
|
||
final class AppCoordinator: ObservableObject { | ||
|
||
@Published var homeState: HomeState = .init() | ||
@Published var myCoinState: MyCoinState? | ||
|
||
init() { | ||
let myCoinStatePublisher = $homeState | ||
.flatMap(\.$didSelectCoin) | ||
.compactMap { $0 } | ||
.map { Just(MyCoinState(id: $0)) } | ||
.assertNoFailure() | ||
.switchToLatest() | ||
.share() | ||
|
||
myCoinStatePublisher | ||
.map(Optional.some) | ||
.assign(to: &$myCoinState) | ||
|
||
myCoinStatePublisher | ||
.flatMap(\.$didSelectBack) | ||
.filter { $0 } | ||
.map { _ in nil } | ||
.assign(to: &$myCoinState) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// ContentView.swift | ||
// CryptoPrices | ||
// | ||
// Created by Doan Thieu on 28/11/2022. | ||
// | ||
|
||
import Factory | ||
import Home | ||
import MyCoin | ||
import SwiftUI | ||
|
||
struct AppView: View { | ||
|
||
@StateObject private var appCoordinator: AppCoordinator = .init() | ||
@Injected(Container.homeViewModel) private var homeViewModel | ||
@Injected(Container.myCoinViewModel) private var myCoinViewModel | ||
@State private var showingMyCoin = false | ||
|
||
var body: some View { | ||
NavigationView { | ||
ZStack { | ||
HomeView(viewModel: homeViewModel) | ||
.environmentObject(appCoordinator.homeState) | ||
NavigationLink("", isActive: $showingMyCoin) { | ||
if let myCoinState = appCoordinator.myCoinState { | ||
MyCoinView(viewModel: myCoinViewModel) | ||
.environmentObject(myCoinState) | ||
} | ||
} | ||
.labelsHidden() | ||
} | ||
} | ||
.onReceive(appCoordinator.$myCoinState) { | ||
showingMyCoin = $0 != nil | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...DataTestHelpers/Dummy/APICoin+dummy.swift → ...DataTestHelpers/Dummy/APICoin+Dummy.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// APICoin+dummy.swift | ||
// APICoin+Dummy.swift | ||
// Data | ||
// | ||
// Created by Doan Thieu on 09/12/2022. | ||
|
Oops, something went wrong.