Any way to use custom ImageResponseSerializer?

I wanted to use a custom serializer, but unfortunately af.setImage

 public func setImage(withURL url: URL,
                         cacheKey: String? = nil,
                         placeholderImage: UIImage? = nil,
                         serializer: ImageResponseSerializer? = nil,
                         filter: ImageFilter? = nil,
                         progress: ImageDownloader.ProgressHandler? = nil,
                         progressQueue: DispatchQueue = DispatchQueue.main,
                         imageTransition: UIImageView.ImageTransition = .noTransition,
                         runImageTransitionIfCached: Bool = false,
                         completion: ((AFIDataResponse<UIImage>) -> Void)? = nil)

is bound to the final ImageResponseSerializer.

public final class ImageResponseSerializer: ResponseSerializer

So, I'm wondering if there is another way to change the way how Data decodes to UIImage?

What do you think if make

class ImageResponseSerializer


func serializeImage(from data: Data) throws -> Image

be open?

Terms of Service

Privacy Policy

Cookie Policy