Skip to content

Commit f3b1631

Browse files
authored
Remove CLDURLCache, CLDImageCache
1 parent b4eb75c commit f3b1631

55 files changed

Lines changed: 51 additions & 5866 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cloudinary.xcodeproj/project.pbxproj

Lines changed: 4 additions & 228 deletions
Large diffs are not rendered by default.

Cloudinary/Classes/Core/CLDCloudinary.swift

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -64,41 +64,25 @@ public typealias CLDUploadCompletionHandler = (_ response: CLDUploadResult?, _ e
6464

6565
// MARK: Image Cache
6666

67-
/**
68-
Sets Cloudinary SDK's caching policy for images that are downloaded via the SDK's CLDDownloader.
69-
The options are: **None**, **Memory** and **Disk**. default is Disk
70-
*/
71-
open var cachePolicy: CLDImageCachePolicy {
72-
get {
73-
return downloadCoordinator.imageCache.cachePolicy
74-
}
75-
set {
76-
downloadCoordinator.imageCache.cachePolicy = newValue
77-
}
78-
}
7967
open var enableUrlCache: Bool {
8068
get {
81-
return downloadCoordinator.imageCache.cachePolicy == .none
69+
return CLDDownloadCoordinator.enableCache
8270
}
8371
set {
84-
if newValue == true {
85-
downloadCoordinator.imageCache.cachePolicy = .none // turn old cache off
86-
downloadCoordinator.imageCache.maxDiskCapacity = 0 // purge the old cache
87-
}
88-
downloadCoordinator.urlCache.shouldIncludeImages(newValue) // turn on the new cache if true
72+
CLDDownloadCoordinator.enableCache = newValue
8973
}
9074
}
9175

9276
/**
9377
Sets Cloudinary SDK's image cache maximum disk capacity.
9478
default is 150 MB.
9579
*/
96-
open var cacheMaxDiskCapacity: UInt64 {
80+
open var cacheMaxDiskCapacity: Int {
9781
get {
98-
return downloadCoordinator.imageCache.maxDiskCapacity
82+
return CLDDownloadCoordinator.urlCache.diskCapacity
9983
}
10084
set {
101-
downloadCoordinator.imageCache.maxDiskCapacity = newValue
85+
CLDDownloadCoordinator.urlCache.diskCapacity = newValue
10286
}
10387
}
10488

@@ -108,48 +92,12 @@ public typealias CLDUploadCompletionHandler = (_ response: CLDUploadResult?, _ e
10892
*/
10993
open var cacheMaxMemoryTotalCost: Int {
11094
get {
111-
return downloadCoordinator.imageCache.maxMemoryTotalCost
112-
}
113-
set {
114-
downloadCoordinator.imageCache.maxMemoryTotalCost = newValue
115-
}
116-
}
117-
118-
/**
119-
Sets Cloudinary SDK's asset cache maximum disk capacity.
120-
default is 150 MB.
121-
*/
122-
open var cacheAssetMaxDiskCapacity: Int {
123-
get {
124-
return downloadCoordinator.urlCache.diskCapacity
125-
}
126-
set {
127-
downloadCoordinator.urlCache.updateDiskCapacity(newValue)
128-
}
129-
}
130-
131-
/**
132-
Sets Cloudinary SDK's asset cache maximum memory total cost.
133-
default is 30 MB.
134-
*/
135-
open var cacheAssetMaxMemoryTotalCost: Int {
136-
get {
137-
return downloadCoordinator.urlCache.memoryCapacity
95+
return CLDDownloadCoordinator.urlCache.memoryCapacity
13896
}
13997
set {
140-
downloadCoordinator.urlCache.updateMemoryCapacity(newValue)
98+
CLDDownloadCoordinator.urlCache.memoryCapacity = newValue
14199
}
142100
}
143-
144-
/**
145-
Removes an image from the downloaded images cache, both disk and memory.
146-
147-
- parameter key: The full url of the image to remove.
148-
149-
*/
150-
open func removeFromCache(key: String) {
151-
downloadCoordinator.imageCache.removeCacheImageForKey(key)
152-
}
153101

154102
// MARK: - Init
155103

0 commit comments

Comments
 (0)