How to programmatically detect there is enough space to save the video to camera roll?

478 views Asked by At

For example, my iPhone has 60MB free storage space and I have videoA which size is 23MB, and videoB which size is 47MB. In my App, i am trying to save the selected video to camera roll. Both videoA and videoB are smaller than the available free space but I can only successfully save videoA to camera roll. It's fine that I can not save the videoB because its in very limited space but is there any programmatically way to detect this?
I have tried "How to detect total available/free disk space on the iPhone/iPad device? ". But the free space I got from this code is quite different from what I see in the Settings->General->Usage->STORAGE. The free space I got from the code is 215MB. No idea what causes this difference.

0

There are 0 answers