mirror of
https://github.com/XITRIX/iTorrent.git
synced 2026-05-30 11:46:50 +00:00
Mac Catalyst support added
This commit is contained in:
@@ -12,6 +12,8 @@ import WidgetKit
|
||||
struct ProgressWidgetBundle: WidgetBundle {
|
||||
var body: some Widget {
|
||||
// ProgressWidget()
|
||||
#if canImport(ActivityKit)
|
||||
ProgressWidgetLiveActivity()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// Created by Даниил Виноградов on 06.04.2024.
|
||||
//
|
||||
|
||||
#if canImport(ActivityKit)
|
||||
import ActivityKit
|
||||
import SwiftUI
|
||||
import WidgetKit
|
||||
@@ -88,3 +89,4 @@ struct ProgressWidgetLiveActivity: Widget {
|
||||
// ProgressWidgetAttributes.ContentState(progress: 0.2, downSpeed: 2000, upSpeed: 1000, timeRemainig: "Осталось САСАТБ", timeStamp: .now)
|
||||
// ProgressWidgetAttributes.ContentState(progress: 0.7, downSpeed: 12000000, upSpeed: 1000000, timeRemainig: "Осталось САСАТБ", timeStamp: .now)
|
||||
//}
|
||||
#endif
|
||||
|
||||
Submodule Submodules/LibTorrent-Swift updated: 170c8abb1c...73652b2e76
@@ -89,7 +89,7 @@ class SceneDelegate: MvvmSceneDelegate {
|
||||
|
||||
override func binding() {
|
||||
bindLiveActivity()
|
||||
bind(in: disposeBag) {
|
||||
disposeBag.bind {
|
||||
tintColorBind
|
||||
appAppearanceBind
|
||||
backgroundDownloadModeBind
|
||||
|
||||
@@ -16,5 +16,7 @@
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.personal-information.location</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -14,7 +14,7 @@ import CoreTelephony
|
||||
|
||||
class NetworkMonitoringService {
|
||||
@Published var availableInterfaces: [NWInterface] = []
|
||||
#if canImport(CoreTelephony)
|
||||
#if canImport(CoreTelephony) && !targetEnvironment(macCatalyst)
|
||||
@Published var cellularState: CTCellularDataRestrictedState = .restrictedStateUnknown
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@ class NetworkMonitoringService {
|
||||
updateAvailableInterfaces()
|
||||
}
|
||||
|
||||
#if canImport(CoreTelephony)
|
||||
#if canImport(CoreTelephony) && !targetEnvironment(macCatalyst)
|
||||
cellularData.cellularDataRestrictionDidUpdateNotifier = { [weak self] newState in
|
||||
guard let self else { return }
|
||||
cellularState = newState
|
||||
@@ -37,14 +37,14 @@ class NetworkMonitoringService {
|
||||
}
|
||||
|
||||
private let monitor = NWPathMonitor()
|
||||
#if canImport(CoreTelephony)
|
||||
#if canImport(CoreTelephony) && !targetEnvironment(macCatalyst)
|
||||
private let cellularData = CTCellularData()
|
||||
#endif
|
||||
}
|
||||
|
||||
private extension NetworkMonitoringService {
|
||||
func updateAvailableInterfaces() {
|
||||
#if canImport(CoreTelephony)
|
||||
#if canImport(CoreTelephony) && !targetEnvironment(macCatalyst)
|
||||
let isCellularRestricted = cellularData.restrictedState == .restricted
|
||||
#else
|
||||
let isCellularRestricted = false
|
||||
|
||||
@@ -37,7 +37,7 @@ class RssModel: Hashable, Codable {
|
||||
init(link: URL) async throws {
|
||||
xmlLink = link
|
||||
|
||||
let (data, response) = try await URLSession.shared.data(from: xmlLink)
|
||||
let (data, _) = try await URLSession.shared.data(from: xmlLink)
|
||||
guard let contents = String(data: data, encoding: .utf8)
|
||||
else { throw Error.corruptedData }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user