-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 a method for setting preconfigured PINRemoteImageManager #1124
Changes from 1 commit
e3ca0dc
f189a83
9919bdb
8430060
b23daf6
683ca29
31a6fbb
a2bdf7b
2dbef33
e19bb45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,10 @@ @interface ASPINRemoteImageManager : PINRemoteImageManager | |
@end | ||
|
||
@implementation ASPINRemoteImageManager | ||
{ | ||
@private | ||
PINRemoteImageManager *_preconfiguredPINRemoteImageManager; | ||
} | ||
|
||
//Share image cache with sharedImageManager image cache. | ||
- (id <PINRemoteImageCaching>)defaultImageCache | ||
|
@@ -155,9 +159,18 @@ + (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSe | |
|
||
- (PINRemoteImageManager *)sharedPINRemoteImageManager | ||
{ | ||
if (_preconfiguredPINRemoteImageManager) { | ||
return _preconfiguredPINRemoteImageManager; | ||
} | ||
return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil]; | ||
} | ||
|
||
- (PINRemoteImageManager *)setPreconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager | ||
{ | ||
_preconfiguredPINRemoteImageManager = preconfiguredPINRemoteImageManager; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add a lock here. Furthermore why do we return the same object here and od not make it a regular setter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I was going to make it return a void since it is setting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me make it thread safe. |
||
return _preconfiguredPINRemoteImageManager; | ||
} | ||
|
||
- (BOOL)sharedImageManagerSupportsMemoryRemoval | ||
{ | ||
static BOOL sharedImageManagerSupportsMemoryRemoval = NO; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thread safe? Do we have to lock this?