UIKitPlus icon indicating copy to clipboard operation
UIKitPlus copied to clipboard

`ImageLoader` should remove image for bad `url`

Open markst opened this issue 3 years ago • 1 comments

When using a bad image url for a UImage :

UImage(url: $viewModel.map({ $0?.image }), loader: .defaultFade)

The existing image is kept, this is a problem when reusing a UImage.

Since ImageLoader does check the url is 'valid', perhaps it should reset the image before returning? https://github.com/MihaelIsaev/UIKitPlus/blob/master/Classes/Objects/ImageLoader.swift#L44

markst avatar Mar 29 '22 17:03 markst

Also wonder why a dispatch on the loaderQueue is queued from a .main dispatch? https://github.com/MihaelIsaev/UIKitPlus/blob/master/Classes/Objects/ImageLoader.swift#L38

Why not simplify and simply dispatch on the loaderQueue.

markst avatar Mar 29 '22 17:03 markst