Skip to content

Commit 08ee51c

Browse files
committed
Default to document directory
1 parent a890d78 commit 08ee51c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Source/Shared/Storage/DiskStorage.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ final public class DiskStorage<T> {
2727
url = directory
2828
} else {
2929
url = try fileManager.url(
30-
for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true
30+
for: .documentDirectory,
31+
in: .userDomainMask,
32+
appropriateFor: nil,
33+
create: true
3134
)
3235
}
3336

Tests/iOS/Tests/Storage/DiskStorageTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class DiskStorageTests: XCTestCase {
3030
/// Test that it returns the correct path
3131
func testDefaultPath() {
3232
let paths = NSSearchPathForDirectoriesInDomains(
33-
.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true
33+
.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true
3434
)
3535
let path = "\(paths.first!)/\(config.name.capitalized)"
3636
XCTAssertEqual(storage.path, path)

0 commit comments

Comments
 (0)