Give a prefix to make ASImageIdentifier typealias

This commit is contained in:
Adlai Holler 2015-09-18 23:32:52 -07:00
parent f20a0d4bc0
commit f37a88d2e4

View File

@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol ASMultiplexImageNodeDelegate; @protocol ASMultiplexImageNodeDelegate;
@protocol ASMultiplexImageNodeDataSource; @protocol ASMultiplexImageNodeDataSource;
typedef __kindof NSObject<NSCopying> * ImageIdentifier; typedef __kindof NSObject<NSCopying> * ASImageIdentifier;
extern NSString *const ASMultiplexImageNodeErrorDomain; extern NSString *const ASMultiplexImageNodeErrorDomain;
@ -38,8 +38,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
* @abstract ASMultiplexImageNode is an image node that can load and display multiple versions of an image. For * @abstract ASMultiplexImageNode is an image node that can load and display multiple versions of an image. For
* example, it can display a low-resolution version of an image while the high-resolution version is loading. * example, it can display a low-resolution version of an image while the high-resolution version is loading.
* *
* @discussion ASMultiplexImageNode begins loading images when its <imageIdentifiers> property is set. For each image * @discussion ASMultiplexImageNode begins loading images when its <esource can either return a UIImage directly, or a URL the image node should load.
* identifier, the data source can either return a UIImage directly, or a URL the image node should load.
*/ */
@interface ASMultiplexImageNode : ASImageNode @interface ASMultiplexImageNode : ASImageNode
@ -80,10 +79,10 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
* *
* @see <downloadsIntermediateImages> for more information on the image loading process. * @see <downloadsIntermediateImages> for more information on the image loading process.
*/ */
@property (nonatomic, readwrite, copy) NSArray<ImageIdentifier> *imageIdentifiers; @property (nonatomic, readwrite, copy) NSArray<ASImageIdentifier> *imageIdentifiers;
/** /**
* @abstract Notify the receiver that its data source has new UIImages or NSURLs available for <imageIdentifiers>. * @abstract Notify the receiver SSAAthat its data source has new UIImages or NSURLs available for <imageIdentifiers>.
* *
* @discussion If a higher-quality image than is currently displayed is now available, it will be loaded. * @discussion If a higher-quality image than is currently displayed is now available, it will be loaded.
*/ */
@ -94,12 +93,12 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
* *
* @discussion This value may differ from <displayedImageIdentifier> if the image hasn't yet been displayed. * @discussion This value may differ from <displayedImageIdentifier> if the image hasn't yet been displayed.
*/ */
@property (nullable, nonatomic, readonly) ImageIdentifier loadedImageIdentifier; @property (nullable, nonatomic, readonly) ASImageIdentifier loadedImageIdentifier;
/** /**
* @abstract The identifier for the image that the receiver is currently displaying, or nil. * @abstract The identifier for the image that the receiver is currently displaying, or nil.
*/ */
@property (nullable, nonatomic, readonly) ImageIdentifier displayedImageIdentifier; @property (nullable, nonatomic, readonly) ASImageIdentifier displayedImageIdentifier;
@end @end
@ -127,7 +126,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
*/ */
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode - (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
didUpdateDownloadProgress:(CGFloat)downloadProgress didUpdateDownloadProgress:(CGFloat)downloadProgress
forImageWithIdentifier:(ImageIdentifier)imageIdentifier; forImageWithIdentifier:(ASImageIdentifier)imageIdentifier;
/** /**
* @abstract Notification that the image node's download has finished. * @abstract Notification that the image node's download has finished.
@ -136,7 +135,7 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) {
* @param error The error that occurred while downloading, if one occurred; nil otherwise. * @param error The error that occurred while downloading, if one occurred; nil otherwise.
*/ */
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode - (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier didFinishDownloadingImageWithIdentifier:(ASImageIdentifier)imageIdentifier
error:(nullable NSError *)error; error:(nullable NSError *)error;
/** /**
@ -151,9 +150,9 @@ didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier
*/ */
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode - (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
didUpdateImage:(nullable UIImage *)image didUpdateImage:(nullable UIImage *)image
withIdentifier:(nullable ImageIdentifier)imageIdentifier withIdentifier:(nullable ASImageIdentifier)imageIdentifier
fromImage:(nullable UIImage *)previousImage fromImage:(nullable UIImage *)previousImage
withIdentifier:(nullable ImageIdentifier)previousImageIdentifier; withIdentifier:(nullable ASImageIdentifier)previousImageIdentifier;
/** /**
* @abstract Notification that the image node displayed a new image. * @abstract Notification that the image node displayed a new image.
@ -164,7 +163,7 @@ didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier
*/ */
- (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode - (void)multiplexImageNode:(ASMultiplexImageNode *)imageNode
didDisplayUpdatedImage:(nullable UIImage *)image didDisplayUpdatedImage:(nullable UIImage *)image
withIdentifier:(nullable ImageIdentifier)imageIdentifier; withIdentifier:(nullable ASImageIdentifier)imageIdentifier;
/** /**
* @abstract Notification that the image node finished displaying an image. * @abstract Notification that the image node finished displaying an image.
@ -192,7 +191,7 @@ didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier
* URL to the image via -multiplexImageNode:URLForImageIdentifier:. * URL to the image via -multiplexImageNode:URLForImageIdentifier:.
* @returns A UIImage corresponding to `imageIdentifier`, or nil if none is available. * @returns A UIImage corresponding to `imageIdentifier`, or nil if none is available.
*/ */
- (nullable UIImage *)multiplexImageNode:(ASMultiplexImageNode *)imageNode imageForImageIdentifier:(ImageIdentifier)imageIdentifier; - (nullable UIImage *)multiplexImageNode:(ASMultiplexImageNode *)imageNode imageForImageIdentifier:(ASImageIdentifier)imageIdentifier;
/** /**
* @abstract An image URL for the specified identifier. * @abstract An image URL for the specified identifier.
@ -203,7 +202,7 @@ didFinishDownloadingImageWithIdentifier:(ImageIdentifier)imageIdentifier
* multiplexImageNode:imageForImageIdentifier:]> instead. * multiplexImageNode:imageForImageIdentifier:]> instead.
* @returns An NSURL for the image identified by `imageIdentifier`, or nil if none is available. * @returns An NSURL for the image identified by `imageIdentifier`, or nil if none is available.
*/ */
- (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ImageIdentifier)imageIdentifier; - (nullable NSURL *)multiplexImageNode:(ASMultiplexImageNode *)imageNode URLForImageIdentifier:(ASImageIdentifier)imageIdentifier;
@end @end