-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cf0dca
commit 51a54ad
Showing
4 changed files
with
48 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
WITH_V: false | ||
DEFAULT_BUMP: patch |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Copyright © 2023 Alexander Romanov | ||
// AdViewModel.swift, created on 30.06.2023 | ||
// | ||
|
||
import SwiftUI | ||
import OversizeNetwork | ||
import Factory | ||
import OversizeServices | ||
|
||
@MainActor | ||
public class AdViewModel: ObservableObject { | ||
@Injected(\.networkService) var networkService | ||
|
||
@Published var appAd: Components.Schemas.AdBanner? | ||
|
||
public func fetchAdBanners() async { | ||
let status = await networkService.fetchAdsBanners() | ||
switch status { | ||
case .success(let banners): | ||
appAd = banners.filter { $0.id != Int(Info.app.appStoreID ?? "") }.randomElement() | ||
case .failure: | ||
break | ||
} | ||
} | ||
|
||
} |