Skip to content

Commit b9bcf51

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents dfafeb8 + d50181b commit b9bcf51

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

README.md

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -130,40 +130,8 @@ let string: String? = SKCache.shared.get(forKey: "string")
130130

131131
### <a name="disk-storage"></a> Enable disk storage
132132

133-
As mentioned `SKCache` supports optionally disk storage. All objects will be stored in the Cache directory of the device. To enable disk storage simply add `SKCache.load()` in the `application(, didFinishLaunchingWithOptions:)` in `AppDelegate.swift`:
134-
135-
```swift
136-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
137-
138-
.
139-
.
140-
.
141-
142-
do {
143-
try SKCache.load()
144-
} catch {
145-
print(error)
146-
}
147-
148-
return true
149-
}
150-
```
151-
But that only will try to load the cache with objects. To fully utilize the disk storage `SKCache.save()` must be added in the `applicationDidEnterBackground(_)`:
152-
153-
```swift
154-
func applicationDidEnterBackground(_ application: UIApplication) {
155-
156-
.
157-
.
158-
.
159-
160-
do {
161-
try SKCache.save()
162-
} catch {
163-
print(error)
164-
}
165-
}
166-
```
133+
As of version 1.3.0 disk storage is enabled by default. There is no need to call aditional method to load the cache with objects.
134+
A new property called isOnlyInMemory was introduced to indicate wether the cached objects will be saved on the disk space or will remain in the memory.
167135

168136
## Installation
169137

0 commit comments

Comments
 (0)