text: //
  //  UIImageView+XHURLDownload.h
  //  XHImageViewer
  //
  //  Created by 曾 宪华 on 14-2-18.
  //  Copyright (c) 2014年 嗨，我是曾宪华(@xhzengAIB)，曾加入YY Inc.担任高级移动开发工程师，拍立秀App联合创始人，热衷于简洁、而富有理性的事物 QQ:543413507 主页:http://zengxianhua.com All rights reserved.
  //
  
  #import <UIKit/UIKit.h>
  
  typedef NS_ENUM(NSInteger, UIImageViewURLDownloadState) {
      UIImageViewURLDownloadStateUnknown = 0,
      UIImageViewURLDownloadStateLoaded,
      UIImageViewURLDownloadStateWaitingForLoad,
      UIImageViewURLDownloadStateNowLoading,
      UIImageViewURLDownloadStateFailed,
  };
  
  @interface UIImageView (XHURLDownload)
  
  // url
  @property (nonatomic, strong) NSURL *url;
  
  // download state
  @property (nonatomic, readonly) UIImageViewURLDownloadState loadingState;
  
  // UI
  @property (nonatomic, strong) UIView *loadingView;
  // Set UIActivityIndicatorView as loadingView
  - (void)setDefaultLoadingView;
  
  // instancetype
  + (id)imageViewWithURL:(NSURL *)url autoLoading:(BOOL)autoLoading;
  
  // Get instance that has UIActivityIndicatorView as loadingView by default
  + (id)indicatorImageView;
  + (id)indicatorImageViewWithURL:(NSURL *)url autoLoading:(BOOL)autoLoading;
  
  // Download
  - (void)loadWithURL:(NSURL *)url;
  - (void)loadWithURL:(NSURL *)url placeholer:(UIImage *)placeholerImage;
  - (void)loadWithURL:(NSURL *)url placeholer:(UIImage *)placeholerImage showActivityIndicatorView:(BOOL)show;
  - (void)loadWithURL:(NSURL *)url placeholer:(UIImage *)placeholerImage showActivityIndicatorView:(BOOL)show completionBlock:(void(^)(UIImage *image, NSURL *url, NSError *error))handler;
  
  - (void)setUrl:(NSURL *)url autoLoading:(BOOL)autoLoading;
  - (void)load;
  
  @end
  