Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. __block UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:activityStyle];
  2. activityIndicator.center = imageView.center;
  3. activityIndicator.hidesWhenStopped = YES;
  4. [imageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
  5. placeholderImage:[UIImage imageNamed:@"placeholder.png"]
  6. success:^(UIImage *image) { [activityIndicator removeFromSuperview]; }
  7. failure:^(NSError *error) { [activityIndicator removeFromSuperview]; }];
  8.  
  9. [imageView addSubview:activityIndicator];
  10. [activityIndicator startAnimating];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement