2016-06-01 20:53:08 +08:00
|
|
|
/*
|
|
|
|
* This file is part of the SDWebImage package.
|
|
|
|
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
2012-03-15 05:05:03 +08:00
|
|
|
|
2020-04-19 12:30:39 +08:00
|
|
|
#import <SDWebImage/SDWebImage.h>
|
2016-06-13 04:23:53 +08:00
|
|
|
|
|
|
|
#if SD_UIKIT || SD_MAC
|
|
|
|
|
2016-06-13 06:47:00 +08:00
|
|
|
#import <MapKit/MapKit.h>
|
2012-03-15 05:05:03 +08:00
|
|
|
|
2012-05-10 20:07:38 +08:00
|
|
|
/**
|
|
|
|
* Integrates SDWebImage async downloading and caching of remote images with MKAnnotationView.
|
|
|
|
*/
|
2012-11-04 16:50:23 +08:00
|
|
|
@interface MKAnnotationView (WebCache)
|
2012-03-15 05:05:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
|
|
|
* @param url The url for the image.
|
|
|
|
*/
|
2017-02-10 20:46:32 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url` and a placeholder.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param url The url for the image.
|
2012-03-15 05:05:03 +08:00
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
2014-06-20 02:54:25 +08:00
|
|
|
* @see sd_setImageWithURL:placeholderImage:options:
|
2012-03-15 05:05:03 +08:00
|
|
|
*/
|
2016-06-03 22:25:21 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
2017-02-10 20:46:32 +08:00
|
|
|
placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`, placeholder and custom options.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param url The url for the image.
|
2012-03-15 05:05:03 +08:00
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
2012-03-15 05:05:03 +08:00
|
|
|
*/
|
2014-06-19 16:55:02 +08:00
|
|
|
|
2016-06-03 22:25:21 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
2017-02-10 20:46:32 +08:00
|
|
|
options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
2018-06-23 15:04:12 +08:00
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`, placeholder, custom options and context.
|
|
|
|
*
|
|
|
|
* The download is asynchronous and cached.
|
|
|
|
*
|
|
|
|
* @param url The url for the image.
|
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
|
|
|
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
|
|
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
|
|
*/
|
|
|
|
|
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
|
|
|
options:(SDWebImageOptions)options
|
|
|
|
context:(nullable SDWebImageContext *)context;
|
|
|
|
|
2012-03-15 05:05:03 +08:00
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param url The url for the image.
|
|
|
|
* @param completedBlock A block called when operation has been completed. This block has no return value
|
2012-11-04 16:50:23 +08:00
|
|
|
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
|
|
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
2015-08-16 22:09:08 +08:00
|
|
|
* indicating if the image was retrieved from the local cache or from the network.
|
2014-09-12 10:24:54 +08:00
|
|
|
* The fourth parameter is the original image url.
|
2012-03-15 05:05:03 +08:00
|
|
|
*/
|
2016-06-03 22:25:21 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
2016-06-07 17:42:26 +08:00
|
|
|
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`, placeholder.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param url The url for the image.
|
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
|
|
|
* @param completedBlock A block called when operation has been completed. This block has no return value
|
2012-11-04 16:50:23 +08:00
|
|
|
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
|
|
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
2015-08-16 22:09:08 +08:00
|
|
|
* indicating if the image was retrieved from the local cache or from the network.
|
2014-09-12 10:24:54 +08:00
|
|
|
* The fourth parameter is the original image url.
|
2012-03-15 05:05:03 +08:00
|
|
|
*/
|
2016-06-03 22:25:21 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
2017-02-10 20:46:32 +08:00
|
|
|
completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`, placeholder and custom options.
|
|
|
|
*
|
2014-06-19 17:13:39 +08:00
|
|
|
* The download is asynchronous and cached.
|
2012-03-15 05:05:03 +08:00
|
|
|
*
|
2014-06-19 16:55:02 +08:00
|
|
|
* @param url The url for the image.
|
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
|
|
|
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
|
|
* @param completedBlock A block called when operation has been completed. This block has no return value
|
2012-11-04 16:50:23 +08:00
|
|
|
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
|
|
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
2015-08-16 22:09:08 +08:00
|
|
|
* indicating if the image was retrieved from the local cache or from the network.
|
2014-09-12 10:24:54 +08:00
|
|
|
* The fourth parameter is the original image url.
|
2012-03-15 05:05:03 +08:00
|
|
|
*/
|
2016-06-03 22:25:21 +08:00
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
|
|
|
options:(SDWebImageOptions)options
|
2016-06-07 17:42:26 +08:00
|
|
|
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
2012-03-15 05:05:03 +08:00
|
|
|
|
2018-04-02 03:24:23 +08:00
|
|
|
/**
|
|
|
|
* Set the imageView `image` with an `url`, placeholder and custom options.
|
|
|
|
*
|
|
|
|
* The download is asynchronous and cached.
|
|
|
|
*
|
|
|
|
* @param url The url for the image.
|
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
|
|
|
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
|
|
* @param progressBlock A block called while image is downloading
|
|
|
|
* @note the progress block is executed on a background queue
|
|
|
|
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
|
|
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
|
|
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
|
|
* indicating if the image was retrieved from the local cache or from the network.
|
|
|
|
* The fourth parameter is the original image url.
|
|
|
|
*/
|
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
|
|
|
options:(SDWebImageOptions)options
|
2018-05-17 14:04:57 +08:00
|
|
|
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
2018-04-02 03:24:23 +08:00
|
|
|
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
|
|
|
|
|
|
/**
|
2018-06-23 15:04:12 +08:00
|
|
|
* Set the imageView `image` with an `url`, placeholder, custom options and context.
|
2018-04-02 03:24:23 +08:00
|
|
|
*
|
|
|
|
* The download is asynchronous and cached.
|
|
|
|
*
|
|
|
|
* @param url The url for the image.
|
|
|
|
* @param placeholder The image to be set initially, until the image request finishes.
|
|
|
|
* @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
|
|
|
|
* @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
|
|
|
|
* @param progressBlock A block called while image is downloading
|
|
|
|
* @note the progress block is executed on a background queue
|
|
|
|
* @param completedBlock A block called when operation has been completed. This block has no return value
|
|
|
|
* and takes the requested UIImage as first parameter. In case of error the image parameter
|
|
|
|
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
|
|
|
|
* indicating if the image was retrieved from the local cache or from the network.
|
|
|
|
* The fourth parameter is the original image url.
|
|
|
|
*/
|
|
|
|
- (void)sd_setImageWithURL:(nullable NSURL *)url
|
|
|
|
placeholderImage:(nullable UIImage *)placeholder
|
|
|
|
options:(SDWebImageOptions)options
|
|
|
|
context:(nullable SDWebImageContext *)context
|
2018-05-17 14:04:57 +08:00
|
|
|
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
2018-04-02 03:24:23 +08:00
|
|
|
completed:(nullable SDExternalCompletionBlock)completedBlock;
|
|
|
|
|
2012-05-12 06:37:37 +08:00
|
|
|
@end
|
2016-06-13 04:23:53 +08:00
|
|
|
|
|
|
|
#endif
|