Skip to content

Commit

Permalink
Fix swift build
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jul 7, 2024
1 parent 320fc34 commit 11ecb6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/NukeExtensions/ImageViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extension TVPosterView: Nuke_ImageDisplaying {
@MainActor
@discardableResult public func loadImage(
with url: URL?,
options: ImageLoadingOptions = ImageLoadingOptions.shared,
options: ImageLoadingOptions? = nil,
into view: ImageDisplayingView,
completion: @escaping (_ result: Result<ImageResponse, ImagePipeline.Error>) -> Void
) -> ImageTask? {
Expand Down Expand Up @@ -122,13 +122,13 @@ extension TVPosterView: Nuke_ImageDisplaying {
@MainActor
@discardableResult public func loadImage(
with url: URL?,
options: ImageLoadingOptions = ImageLoadingOptions.shared,
options: ImageLoadingOptions? = nil,
into view: ImageDisplayingView,
progress: ((_ response: ImageResponse?, _ completed: Int64, _ total: Int64) -> Void)? = nil,
completion: ((_ result: Result<ImageResponse, ImagePipeline.Error>) -> Void)? = nil
) -> ImageTask? {
let controller = ImageViewController.controller(for: view)
return controller.loadImage(with: url.map({ ImageRequest(url: $0) }), options: options, progress: progress, completion: completion)
return controller.loadImage(with: url.map({ ImageRequest(url: $0) }), options: options ?? .shared, progress: progress, completion: completion)
}

/// Loads an image with the given request and displays it in the view.
Expand All @@ -137,11 +137,11 @@ extension TVPosterView: Nuke_ImageDisplaying {
@MainActor
@discardableResult public func loadImage(
with request: ImageRequest?,
options: ImageLoadingOptions = ImageLoadingOptions.shared,
options: ImageLoadingOptions? = nil,
into view: ImageDisplayingView,
completion: @escaping (_ result: Result<ImageResponse, ImagePipeline.Error>) -> Void
) -> ImageTask? {
loadImage(with: request, options: options, into: view, progress: nil, completion: completion)
loadImage(with: request, options: options ?? .shared, into: view, progress: nil, completion: completion)
}

/// Loads an image with the given request and displays it in the view.
Expand Down Expand Up @@ -170,13 +170,13 @@ extension TVPosterView: Nuke_ImageDisplaying {
@MainActor
@discardableResult public func loadImage(
with request: ImageRequest?,
options: ImageLoadingOptions = ImageLoadingOptions.shared,
options: ImageLoadingOptions? = nil,
into view: ImageDisplayingView,
progress: ((_ response: ImageResponse?, _ completed: Int64, _ total: Int64) -> Void)? = nil,
completion: ((_ result: Result<ImageResponse, ImagePipeline.Error>) -> Void)? = nil
) -> ImageTask? {
let controller = ImageViewController.controller(for: view)
return controller.loadImage(with: request, options: options, progress: progress, completion: completion)
return controller.loadImage(with: request, options: options ?? .shared, progress: progress, completion: completion)
}

/// Cancels an outstanding request associated with the view.
Expand Down

0 comments on commit 11ecb6c

Please sign in to comment.