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 #72 from nimblehq/release/0.4.0
Release 0.4.0
- Loading branch information
Showing
64 changed files
with
1,271 additions
and
298 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
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ fastlane/FastlaneRunner | |
# Bundler | ||
.bundle | ||
vendor/bundle | ||
|
||
# SourcePackages folder | ||
SourcePackages |
Large diffs are not rendered by default.
Oops, something went wrong.
125 changes: 75 additions & 50 deletions
125
CryptoPrices.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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,52 +1,77 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "CwlCatchException", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea", | ||
"version": "2.1.1" | ||
} | ||
}, | ||
{ | ||
"package": "CwlPreconditionTesting", | ||
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688", | ||
"version": "2.1.0" | ||
} | ||
}, | ||
{ | ||
"package": "Nimble", | ||
"repositoryURL": "https://github.com/Quick/Nimble", | ||
"state": { | ||
"branch": null, | ||
"revision": "b7f6c49acdb247e3158198c5448b38c3cc595533", | ||
"version": "11.2.1" | ||
} | ||
}, | ||
{ | ||
"package": "Pilot", | ||
"repositoryURL": "https://github.com/Thieurom/Pilot", | ||
"state": { | ||
"branch": null, | ||
"revision": "d0c990223f3447fd912ae716d03676fd1db714af", | ||
"version": "0.5.1" | ||
} | ||
}, | ||
{ | ||
"package": "Quick", | ||
"repositoryURL": "https://github.com/Quick/Quick", | ||
"state": { | ||
"branch": null, | ||
"revision": "16910e406be96e08923918315388c3e989deac9e", | ||
"version": "6.1.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
"pins" : [ | ||
{ | ||
"identity" : "cwlcatchexception", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlCatchException.git", | ||
"state" : { | ||
"revision" : "35f9e770f54ce62dd8526470f14c6e137cef3eea", | ||
"version" : "2.1.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "cwlpreconditiontesting", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", | ||
"state" : { | ||
"revision" : "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688", | ||
"version" : "2.1.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "factory", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/hmlongco/Factory", | ||
"state" : { | ||
"revision" : "ca5788b8621b185a0fbe6ef05bb9a73b3ef2833f", | ||
"version" : "1.2.9" | ||
} | ||
}, | ||
{ | ||
"identity" : "nimble", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Nimble", | ||
"state" : { | ||
"revision" : "b7f6c49acdb247e3158198c5448b38c3cc595533", | ||
"version" : "11.2.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "pilot", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Thieurom/Pilot", | ||
"state" : { | ||
"revision" : "d0c990223f3447fd912ae716d03676fd1db714af", | ||
"version" : "0.5.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "quick", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Quick/Quick", | ||
"state" : { | ||
"revision" : "16910e406be96e08923918315388c3e989deac9e", | ||
"version" : "6.1.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "showtime", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/KaneCheshire/ShowTime", | ||
"state" : { | ||
"revision" : "f4e976931fc5f9b7a7d011f40c62a250c4ff53ab", | ||
"version" : "2.5.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "wormholy", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/ipavlidakis/Wormholy", | ||
"state" : { | ||
"branch" : "master", | ||
"revision" : "fa6cba3377498701c67720d4911d33b36a5d0bab" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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
40 changes: 40 additions & 0 deletions
40
CryptoPrices/Sources/App/Dependencie Injection/Container+Injection.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Container+Injection.swift | ||
// CryptoPrices | ||
// | ||
// Created by Minh Pham on 21/12/2022. | ||
// | ||
|
||
import Factory | ||
import Home | ||
import MyCoin | ||
import NetworkExtension | ||
import UseCaseProtocol | ||
import NetworkCore | ||
import Pilot | ||
import Repositories | ||
import RepositoryProtocol | ||
import UseCases | ||
|
||
@MainActor | ||
extension Container { | ||
|
||
// Network | ||
static let coinAPI = Factory<CoinAPIProtocol> { Pilot<CoinRoute>() } | ||
|
||
// ViewModels | ||
static let homeViewModel = Factory { | ||
HomeViewModel(myCoinsUseCase: myCoinsUseCase.callAsFunction()) | ||
} | ||
|
||
// Repositories | ||
static let coinRepository = Factory<CoinRepositoryProtocol> { | ||
CoinRepository(coinAPI: coinAPI.callAsFunction()) | ||
} | ||
|
||
// UseCases | ||
static let myCoinsUseCase = Factory<MyCoinsUseCaseProtocol> { | ||
MyCoinsUseCase(repository: coinRepository.callAsFunction()) | ||
|
||
} | ||
} |
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,48 @@ | ||
// | ||
// AppCoordinator.swift | ||
// CryptoPrices | ||
// | ||
// Created by Khanh on 19/12/2022. | ||
// | ||
|
||
import Combine | ||
import Home | ||
import MyCoin | ||
import SwiftUI | ||
|
||
final class AppCoordinator: ObservableObject { | ||
|
||
@Published var state: AppState = .home(HomeState()) | ||
|
||
private var cancellables = Set<AnyCancellable>() | ||
|
||
init() { | ||
$state | ||
.compactMap { currentState -> HomeState? in | ||
if case let .home(homeState) = currentState { | ||
return homeState | ||
} | ||
return nil | ||
} | ||
.flatMap(\.$didSelectCoin) | ||
.filter { $0 } | ||
.sink(receiveValue: { [weak self] _ in | ||
self?.state = .myCoin(MyCoinState()) | ||
}) | ||
.store(in: &cancellables) | ||
|
||
$state | ||
.compactMap { currentState -> MyCoinState? in | ||
if case let .myCoin(myCoinState) = currentState { | ||
return myCoinState | ||
} | ||
return nil | ||
} | ||
.flatMap(\.$didSelectBack) | ||
.filter { $0 } | ||
.sink(receiveValue: { [weak self] _ in | ||
self?.state = .home(HomeState()) | ||
}) | ||
.store(in: &cancellables) | ||
} | ||
} |
Oops, something went wrong.