kean/DFImageManager

[Question] How to implement this lib in WatchOS

Closed this issue · 2 comments

I see you have supported WatchOS.
In WatchOS, It don't have UIImageView anymore. Instead, It use WKInterfaceImage.
So, I can't use UIImageView's extension method to show image.

I have tried to download images as below:

[DFImageManager imageTaskForResource:imageURL
                                  completion:^(UIImage* _Nullable image, NSError* _Nullable error, DFImageResponse* _Nullable response, DFImageTask* _Nonnull imageTask) {
            // Set Image to show
}];

But block isn't called.
Do you have any suggestion for me in this case?
Thanks!

kean commented

Hi, you should resume task after creating it:

[[DFImageManager imageTaskForResource:imageURL
                                  completion:^(UIImage* _Nullable image, NSError* _Nullable error, DFImageResponse* _Nullable response, DFImageTask* _Nonnull imageTask) {
            // Set Image to show
}] resume];

Thank you for your kind help!