Merge branch 'master' of https://github.com/rs/SDWebImage into 5.x
This commit is contained in:
commit
34cca584c2
|
@ -39,7 +39,7 @@
|
||||||
/**
|
/**
|
||||||
All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority
|
All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, strong, readwrite, nullable) NSArray<SDWebImageCoder>* coders;
|
@property (nonatomic, strong, readwrite, nullable) NSArray<id<SDWebImageCoder>> *coders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add a new coder to the end of coders array. Which has the highest priority.
|
Add a new coder to the end of coders array. Which has the highest priority.
|
||||||
|
|
|
@ -59,15 +59,15 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray<SDWebImageCoder> *)coders {
|
- (NSArray<id<SDWebImageCoder>> *)coders {
|
||||||
__block NSArray<SDWebImageCoder> *sortedCoders = nil;
|
__block NSArray<id<SDWebImageCoder>> *sortedCoders = nil;
|
||||||
dispatch_sync(self.mutableCodersAccessQueue, ^{
|
dispatch_sync(self.mutableCodersAccessQueue, ^{
|
||||||
sortedCoders = (NSArray<SDWebImageCoder> *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects];
|
sortedCoders = (NSArray<id<SDWebImageCoder>> *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects];
|
||||||
});
|
});
|
||||||
return sortedCoders;
|
return sortedCoders;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setCoders:(NSArray<SDWebImageCoder> *)coders {
|
- (void)setCoders:(NSArray<id<SDWebImageCoder>> *)coders {
|
||||||
dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
|
dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
|
||||||
self.mutableCoders = [coders mutableCopy];
|
self.mutableCoders = [coders mutableCopy];
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue