Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for providing additional info to network image node delegate #775

Merged
merged 4 commits into from
Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix stuff and take Michael's advice
  • Loading branch information
Adlai Holler committed Jan 30, 2018
commit be57d7111b2f270e4d3b2f252be8604cb0739d8e
2 changes: 1 addition & 1 deletion Source/Details/ASBasicImageDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @note It is strongly recommended you include PINRemoteImage and use @c ASPINRemoteImageDownloader instead.
*/
+ (ASBasicImageDownloader *)sharedImageDownloader;
@property (class, readonly) ASBasicImageDownloader *sharedImageDownloader;

+ (instancetype)new __attribute__((unavailable("+[ASBasicImageDownloader sharedImageDownloader] must be used.")));
- (instancetype)init __attribute__((unavailable("+[ASBasicImageDownloader sharedImageDownloader] must be used.")));
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASPINRemoteImageDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
* This is the default downloader used by network backed image nodes if PINRemoteImage and PINCache are
* available. It uses PINRemoteImage's features to provide caching and progressive image downloads.
*/
+ (ASPINRemoteImageDownloader *)sharedDownloader;
@property (class, readonly) ASPINRemoteImageDownloader *sharedDownloader;


/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASPINRemoteImageDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ @interface ASPINRemoteImageDownloader ()

@implementation ASPINRemoteImageDownloader

+ (instancetype)sharedDownloader
+ (ASPINRemoteImageDownloader *)sharedDownloader
{

static dispatch_once_t onceToken = 0;
Expand Down
4 changes: 2 additions & 2 deletions Tests/ASBasicImageDownloaderTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ - (void)testAsynchronouslyDownloadTheSameURLTwice
[downloader downloadImageWithURL:URL
callbackQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
downloadProgress:nil
completion:^(id<ASImageContainerProtocol> _Nullable image, NSError * _Nullable error, id _Nullable downloadIdentifier) {
completion:^(id<ASImageContainerProtocol> _Nullable image, NSError * _Nullable error, id _Nullable downloadIdentifier, id _Nullable userInfo) {
[firstExpectation fulfill];
}];

[downloader downloadImageWithURL:URL
callbackQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
downloadProgress:nil
completion:^(id<ASImageContainerProtocol> _Nullable image, NSError * _Nullable error, id _Nullable downloadIdentifier) {
completion:^(id<ASImageContainerProtocol> _Nullable image, NSError * _Nullable error, id _Nullable downloadIdentifier, id _Nullable userInfo) {
[secondExpectation fulfill];
}];

Expand Down
2 changes: 1 addition & 1 deletion Tests/ASMultiplexImageNodeTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ - (void)testUncachedDownload

// Simulate completion.
ASImageDownloaderCompletion completionBlock = [inv as_argumentAtIndexAsObject:5];
completionBlock([self _testImage], nil, nil);
completionBlock([self _testImage], nil, nil, nil);
});

NSNumber *imageIdentifier = @1;
Expand Down