Nuke
Nuke copied to clipboard
Async/await for NukeExtensions
Is there any async/await API planned?
import Nuke
import NukeExtensions
extension UIImageView {
enum ImageLoadingError: Error {
case pathIsNil
case badURL
}
func loadImage(path: String?) async throws {
guard let path else {
throw ImageLoadingError.pathIsNil
}
guard let url = URL(string: path) else {
throw ImageLoadingError.badURL
}
NukeExtensions.loadImage(with: url, into: self) <- here
}
}
I haven't considered it, but it would be nice to add.