Skip to content

Commit

Permalink
Fix concurrency issues and move to Swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DePasqualeOrg committed Oct 10, 2024
1 parent 7aff8d1 commit 311ef5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ fastlane/test_output
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
iOSInjectionProject/

.DS_Store
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions Sources/NetworkImage/NetworkImageModel.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 311ef5b

Please sign in to comment.