From 999d4f5a4d3d81a11dc6a108e64a6b0c037d20b4 Mon Sep 17 00:00:00 2001 From: Daniil Vinogradov Date: Wed, 25 Dec 2024 17:22:03 +0100 Subject: [PATCH] Fucking Swift 6 --- .../Preferences/Patreon/PatreonPreferencesViewModel.swift | 2 +- iTorrent/Screens/Preferences/Root/PreferencesViewModel.swift | 2 +- .../Preferences/TrackersList/TrackersListPreferencesView.swift | 2 +- iTorrent/Screens/Rss/Details/RssDetailsViewModel.swift | 2 +- iTorrent/Screens/Rss/List/Cells/RssFeedCellViewModel.swift | 2 +- iTorrent/Screens/Rss/List/RssListViewModel.swift | 2 +- .../Services/BackgroundService/AudioBackgroundService.swift | 2 +- .../Services/BackgroundService/LocationBackgroundService.swift | 2 +- iTorrent/Services/LiveActivityService/LiveActivityService.swift | 2 +- iTorrent/Services/Patreon/PatreonService.swift | 2 +- iTorrent/Services/Patreon/Utils/Models/PatreonAccount.swift | 2 +- iTorrent/Services/Patreon/Utils/PatreonWebServer.swift | 2 +- iTorrent/Services/RssFeed/RssModel.swift | 2 +- iTorrent/Services/TrackersListService/TrackersListService.swift | 2 +- iTorrent/Services/WebServer/WebServerService.swift | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/iTorrent/Screens/Preferences/Patreon/PatreonPreferencesViewModel.swift b/iTorrent/Screens/Preferences/Patreon/PatreonPreferencesViewModel.swift index dbb96907..6610dac5 100644 --- a/iTorrent/Screens/Preferences/Patreon/PatreonPreferencesViewModel.swift +++ b/iTorrent/Screens/Preferences/Patreon/PatreonPreferencesViewModel.swift @@ -17,7 +17,7 @@ extension PatreonPreferencesViewModel { } } -class PatreonPreferencesViewModel: BaseViewModel { +class PatreonPreferencesViewModel: BaseViewModel, @unchecked Sendable { let accountState = CurrentValueSubject(.none) required init() { diff --git a/iTorrent/Screens/Preferences/Root/PreferencesViewModel.swift b/iTorrent/Screens/Preferences/Root/PreferencesViewModel.swift index 31f7a4cf..5c024871 100644 --- a/iTorrent/Screens/Preferences/Root/PreferencesViewModel.swift +++ b/iTorrent/Screens/Preferences/Root/PreferencesViewModel.swift @@ -9,7 +9,7 @@ import Combine import MvvmFoundation import SwiftUI -class PreferencesViewModel: BasePreferencesViewModel { +class PreferencesViewModel: BasePreferencesViewModel, @unchecked Sendable { required init() { super.init() binding() diff --git a/iTorrent/Screens/Preferences/TrackersList/TrackersListPreferencesView.swift b/iTorrent/Screens/Preferences/TrackersList/TrackersListPreferencesView.swift index e1c4a28a..26533bfe 100644 --- a/iTorrent/Screens/Preferences/TrackersList/TrackersListPreferencesView.swift +++ b/iTorrent/Screens/Preferences/TrackersList/TrackersListPreferencesView.swift @@ -9,7 +9,7 @@ import LibTorrent import MvvmFoundation import SwiftUI -class TrackersListPreferencesViewModel: BaseViewModel, ObservableObject { +class TrackersListPreferencesViewModel: BaseViewModel, ObservableObject, @unchecked Sendable { @Published var sorces: [TrackersListService.ListState] = [] @Published var isAutoaddingEnabled: Bool diff --git a/iTorrent/Screens/Rss/Details/RssDetailsViewModel.swift b/iTorrent/Screens/Rss/Details/RssDetailsViewModel.swift index 8cf0a7bc..422af245 100644 --- a/iTorrent/Screens/Rss/Details/RssDetailsViewModel.swift +++ b/iTorrent/Screens/Rss/Details/RssDetailsViewModel.swift @@ -28,7 +28,7 @@ extension RssDetailsViewModel { } } -class RssDetailsViewModel: BaseViewModelWith { +class RssDetailsViewModel: BaseViewModelWith, @unchecked Sendable { var rssModel: RssItemModel! @Published var title: String = "" @Published var downloadType: DownloadType? diff --git a/iTorrent/Screens/Rss/List/Cells/RssFeedCellViewModel.swift b/iTorrent/Screens/Rss/List/Cells/RssFeedCellViewModel.swift index 0cf16f70..c9eb4f74 100644 --- a/iTorrent/Screens/Rss/List/Cells/RssFeedCellViewModel.swift +++ b/iTorrent/Screens/Rss/List/Cells/RssFeedCellViewModel.swift @@ -15,7 +15,7 @@ extension RssFeedCellViewModel { } } -class RssFeedCellViewModel: BaseViewModelWith, MvvmSelectableProtocol, MvvmReorderableProtocol { +class RssFeedCellViewModel: BaseViewModelWith, MvvmSelectableProtocol, MvvmReorderableProtocol, @unchecked Sendable { var model: RssModel! var selectAction: (() -> Void)? var canReorder: Bool { true } diff --git a/iTorrent/Screens/Rss/List/RssListViewModel.swift b/iTorrent/Screens/Rss/List/RssListViewModel.swift index f73d6ba2..88596574 100644 --- a/iTorrent/Screens/Rss/List/RssListViewModel.swift +++ b/iTorrent/Screens/Rss/List/RssListViewModel.swift @@ -9,7 +9,7 @@ import Combine import Foundation import MvvmFoundation -class RssListViewModel: BaseCollectionViewModel { +class RssListViewModel: BaseCollectionViewModel, @unchecked Sendable { required init() { super.init() setup() diff --git a/iTorrent/Services/BackgroundService/AudioBackgroundService.swift b/iTorrent/Services/BackgroundService/AudioBackgroundService.swift index a17552cb..820832d8 100644 --- a/iTorrent/Services/BackgroundService/AudioBackgroundService.swift +++ b/iTorrent/Services/BackgroundService/AudioBackgroundService.swift @@ -8,7 +8,7 @@ import AVFoundation import UIKit -class AudioBackgroundService { +class AudioBackgroundService: @unchecked Sendable { private var player: AVAudioPlayer? private var backgroundTask: UIBackgroundTaskIdentifier? private var asyncTask: Task? diff --git a/iTorrent/Services/BackgroundService/LocationBackgroundService.swift b/iTorrent/Services/BackgroundService/LocationBackgroundService.swift index 5df476d6..983caba6 100644 --- a/iTorrent/Services/BackgroundService/LocationBackgroundService.swift +++ b/iTorrent/Services/BackgroundService/LocationBackgroundService.swift @@ -7,7 +7,7 @@ import CoreLocation -class LocationBackgroundService: NSObject { +class LocationBackgroundService: NSObject, @unchecked Sendable { override init() { super.init() locationManager.delegate = self diff --git a/iTorrent/Services/LiveActivityService/LiveActivityService.swift b/iTorrent/Services/LiveActivityService/LiveActivityService.swift index c5c28949..f68fd43d 100644 --- a/iTorrent/Services/LiveActivityService/LiveActivityService.swift +++ b/iTorrent/Services/LiveActivityService/LiveActivityService.swift @@ -6,7 +6,7 @@ // #if canImport(ActivityKit) -import ActivityKit +@preconcurrency import ActivityKit #endif import Combine diff --git a/iTorrent/Services/Patreon/PatreonService.swift b/iTorrent/Services/Patreon/PatreonService.swift index a9036218..a78fc03c 100644 --- a/iTorrent/Services/Patreon/PatreonService.swift +++ b/iTorrent/Services/Patreon/PatreonService.swift @@ -14,7 +14,7 @@ struct PatreonToken: Codable { var refreshToken: String } -class PatreonService { +class PatreonService: @unchecked Sendable { init() { Task { try await fetchCredentials() diff --git a/iTorrent/Services/Patreon/Utils/Models/PatreonAccount.swift b/iTorrent/Services/Patreon/Utils/Models/PatreonAccount.swift index 1cb57898..9365f0ba 100644 --- a/iTorrent/Services/Patreon/Utils/Models/PatreonAccount.swift +++ b/iTorrent/Services/Patreon/Utils/Models/PatreonAccount.swift @@ -43,7 +43,7 @@ extension PatreonService { } } -class PatreonAccount: Codable, Equatable { +class PatreonAccount: Codable, Equatable, @unchecked Sendable { var identifier: String var name: String diff --git a/iTorrent/Services/Patreon/Utils/PatreonWebServer.swift b/iTorrent/Services/Patreon/Utils/PatreonWebServer.swift index f4b23f2e..b123a805 100644 --- a/iTorrent/Services/Patreon/Utils/PatreonWebServer.swift +++ b/iTorrent/Services/Patreon/Utils/PatreonWebServer.swift @@ -8,7 +8,7 @@ import Foundation import GCDWebServers -class PatreonWebServer: GCDWebServer { +class PatreonWebServer: GCDWebServer, @unchecked Sendable { private var completion: ((String?) -> ())? public static let shared = PatreonWebServer() diff --git a/iTorrent/Services/RssFeed/RssModel.swift b/iTorrent/Services/RssFeed/RssModel.swift index aac66884..a5f14e63 100644 --- a/iTorrent/Services/RssFeed/RssModel.swift +++ b/iTorrent/Services/RssFeed/RssModel.swift @@ -11,7 +11,7 @@ import Foundation import MvvmFoundation import SWXMLHash -class RssModel: Hashable, Codable { +class RssModel: Hashable, Codable, @unchecked Sendable { enum Error: Swift.Error { case missingKey case corruptedData diff --git a/iTorrent/Services/TrackersListService/TrackersListService.swift b/iTorrent/Services/TrackersListService/TrackersListService.swift index 8b9c4c2d..2a22c248 100644 --- a/iTorrent/Services/TrackersListService/TrackersListService.swift +++ b/iTorrent/Services/TrackersListService/TrackersListService.swift @@ -35,7 +35,7 @@ extension TrackersListService { } } -class TrackersListService { +class TrackersListService: @unchecked Sendable { let trackerSources: CurrentValueSubject<[ListState.Source: ListState], Never> init() { diff --git a/iTorrent/Services/WebServer/WebServerService.swift b/iTorrent/Services/WebServer/WebServerService.swift index 26a55ac3..23eccdb1 100644 --- a/iTorrent/Services/WebServer/WebServerService.swift +++ b/iTorrent/Services/WebServer/WebServerService.swift @@ -10,7 +10,7 @@ import GCDWebServers import MvvmFoundation import UIKit -class WebServerService: Resolvable { +class WebServerService: Resolvable, @unchecked Sendable { init() { binding() } @Published var isWebServerEnabled: Bool = false