From 0920e7a001547fdea2440d4c9ae00454d2d22627 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Tue, 13 Nov 2012 17:17:39 +0100 Subject: [PATCH] Add activity indicator demo --- Examples/SDWebImage Demo/DetailViewController.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Examples/SDWebImage Demo/DetailViewController.m b/Examples/SDWebImage Demo/DetailViewController.m index 4d6423b..adc1f80 100644 --- a/Examples/SDWebImage Demo/DetailViewController.m +++ b/Examples/SDWebImage Demo/DetailViewController.m @@ -33,7 +33,14 @@ { if (self.imageURL) { - [self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload]; + UIActivityIndicatorView *activityIndicator; + [self.imageView addSubview:activityIndicator = [UIActivityIndicatorView.alloc initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]]; + activityIndicator.center = self.imageView.center; + [activityIndicator startAnimating]; + [self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload completed:^(UIImage *image, NSError *error, BOOL fromCache) + { + [activityIndicator removeFromSuperview]; + }]; } }