From d128c27cad1259004816ba207e2f8a479fcd285c Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Fri, 11 Jun 2010 15:06:04 +0200 Subject: [PATCH] Add `cancelCurrentImageLoading` method to UIImageView+WebCache --- UIImageView+WebCache.h | 1 + UIImageView+WebCache.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/UIImageView+WebCache.h b/UIImageView+WebCache.h index 376269d..34c13ad 100644 --- a/UIImageView+WebCache.h +++ b/UIImageView+WebCache.h @@ -13,5 +13,6 @@ - (void)setImageWithURL:(NSURL *)url; - (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder; +- (void)cancelCurrentImageLoading; @end diff --git a/UIImageView+WebCache.m b/UIImageView+WebCache.m index 229782e..6f79e5b 100644 --- a/UIImageView+WebCache.m +++ b/UIImageView+WebCache.m @@ -46,6 +46,11 @@ } } +- (void)cancelCurrentImageLoading +{ + [[SDWebImageManager sharedManager] cancelForDelegate:self]; +} + - (void)webImageManager:(SDWebImageManager *)imageManager didFinishWithImage:(UIImage *)image { self.image = image;