saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot clear .cache on device

bassebaba opened this issue · comments

try Disk.clear(.caches)
Works in the simulator, but on my device all I get is an error:
"Snapshots" couldn't be removed because you don't have permission to access it.

Save/retrieve works on the device.

iOS 11.1.2 (15B202)

What am I doing wrong? Do I need to ask for some sort of permissions?

Edit: Did a bit of further digging:
https://stackoverflow.com/questions/12488462/ios-directory-structure-whats-snapshots-file

The Snapshots file/folder exists both in the simulator and on the actual device (phone).
The difference is that on the simulator it gets deleted, on the phone I get the error message...

Hey @bassebaba thanks for bringing this to my attention! I fixed this bug in the latest release v0.3.3: 2460655

These special non-removable subdirectories (like "Snapshots") get skipped over now.

Update your pod to this new version and try running your code again.

Works perfect now, thanks for the fast fix!