Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/kean/Nuke.git", from: "11.2.1"),
.package(url: "https://github.com/kean/Nuke.git", from: "12.0.0"),
.package(url: "https://github.com/FluidGroup/swiftui-support.git", from: "0.2.3")
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public struct AsyncMultiplexImageNukeDownloader: AsyncMultiplexImageDownloader {

#endif
let response = try await pipeline.image(for: .init(urlRequest: candidate.urlRequest))
return .init(uiImage: response.image)
return .init(uiImage: response)
}

}
Expand All @@ -42,7 +42,7 @@ public struct SlowDownloader: AsyncMultiplexImageDownloader {
public func download(candidate: AsyncMultiplexImageCandidate) async throws -> Image {
try? await Task.sleep(nanoseconds: 5_000_000_000 - ((UInt64(candidate.index) * 1_000_000_000)))
let response = try await pipeline.image(for: .init(urlRequest: candidate.urlRequest))
return .init(uiImage: response.image)
return .init(uiImage: response)
}

}
Expand Down
4 changes: 2 additions & 2 deletions Sources/AsyncMultiplexImageDemo/Demo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ struct AsyncMultiplexImage_Previews: PreviewProvider {

Group {
AsyncMultiplexImage(
urlsProvider: { size in
multiplexImage: .init(identifier: "", urlsProvider: { size in
buildURLs(
baseURLString:
"https://images.unsplash.com/photo-1492446845049-9c50cc313f00?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8",
size: size
)
},
}),
downloader: SlowDownloader(pipeline: .shared)
) { phase in
switch phase {
Expand Down