diff --git a/.gitignore b/.gitignore index ba1ff08..e27d315 100644 --- a/.gitignore +++ b/.gitignore @@ -87,4 +87,6 @@ fastlane/test_output # After new code Injection tools there's a generated folder /iOSInjectionProject # https://github.com/johnno1962/injectionforxcode -iOSInjectionProject/ \ No newline at end of file +iOSInjectionProject/ + +.DS_Store diff --git a/Package.swift b/Package.swift index 6af4060..c99c384 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/Sources/NetworkImage/NetworkImageModel.swift b/Sources/NetworkImage/NetworkImageModel.swift index a955280..6ee2a1b 100644 --- a/Sources/NetworkImage/NetworkImageModel.swift +++ b/Sources/NetworkImage/NetworkImageModel.swift @@ -1,6 +1,8 @@ import SwiftUI -final class NetworkImageModel: ObservableObject { +@MainActor +final class NetworkImageModel: ObservableObject, Sendable { + @MainActor struct Environment { let transaction: Transaction let imageLoader: NetworkImageLoader @@ -13,7 +15,7 @@ final class NetworkImageModel: ObservableObject { @Published private(set) var state: State = .init() - @MainActor func onAppear(source: ImageSource?, environment: Environment) async { + func onAppear(source: ImageSource?, environment: Environment) async { guard source != self.state.source else { return } guard let source else {