simplify
This commit is contained in:
@@ -26,11 +26,8 @@ class AssetResolver {
|
|||||||
init(fetchOptions: PHFetchOptions, batchTimeout: TimeInterval = 0.00025, cacheSize: Int = 10000, qos: DispatchQoS = .unspecified) {
|
init(fetchOptions: PHFetchOptions, batchTimeout: TimeInterval = 0.00025, cacheSize: Int = 10000, qos: DispatchQoS = .unspecified) {
|
||||||
self.fetchOptions = fetchOptions
|
self.fetchOptions = fetchOptions
|
||||||
self.batchTimeout = batchTimeout
|
self.batchTimeout = batchTimeout
|
||||||
self.assetCache = {
|
self.assetCache = NSCache<NSString, PHAsset>()
|
||||||
let assetCache = NSCache<NSString, PHAsset>()
|
self.assetCache.countLimit = cacheSize
|
||||||
assetCache.countLimit = cacheSize
|
|
||||||
return assetCache
|
|
||||||
}()
|
|
||||||
self.requestQueue = DispatchQueue(label: "assets.requests", qos: qos)
|
self.requestQueue = DispatchQueue(label: "assets.requests", qos: qos)
|
||||||
self.processingQueue = DispatchQueue(label: "assets.processing", qos: qos)
|
self.processingQueue = DispatchQueue(label: "assets.processing", qos: qos)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user