Skip to content

Commit

Permalink
Sendable image loader
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneego committed Jul 20, 2024
1 parent dd763a0 commit a280139
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
12 changes: 0 additions & 12 deletions Legacy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,6 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -1725,7 +1724,6 @@
PRODUCT_NAME = Legacy;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1790,7 +1788,6 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1848,7 +1845,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -1914,7 +1910,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 6.0;
Expand Down Expand Up @@ -1972,7 +1967,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -2034,7 +2028,6 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -2086,7 +2079,6 @@
PROVISIONING_PROFILE_SPECIFIER = "All Dev";
SDKROOT = iphoneos;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -2231,7 +2223,6 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -2286,7 +2277,6 @@
PRODUCT_NAME = Legacy;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -2335,7 +2325,6 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -2374,7 +2363,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down
4 changes: 2 additions & 2 deletions Sources/Network/ImageLoader/HttpImageLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import UIKit
import AppKit
#endif

open class HttpImageLoader: ImageLoader {
public final class HttpImageLoader: ImageLoader {
public let http: Http
public let prerendered: Bool

Expand All @@ -21,7 +21,7 @@ open class HttpImageLoader: ImageLoader {
self.prerendered = prerendered
}

open func load(url: URL, size: CGSize, mode: ResizeMode) async -> ImageLoaderResult {
public func load(url: URL, size: CGSize, mode: ResizeMode) async -> ImageLoaderResult {
actor Render {
func render(data: Data, prerender: Bool) -> EEImage? {
guard let image = EEImage(data: data) else { return nil }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Network/ImageLoader/ImageLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public enum ResizeMode: Sendable {

public typealias ImageLoaderResult = Result<(data: Data, image: EEImage), ImageLoaderError>

public protocol ImageLoader {
public protocol ImageLoader: Sendable {
func load(url: URL, size: CGSize, mode: ResizeMode) async -> ImageLoaderResult
}

0 comments on commit a280139

Please sign in to comment.