Search code examples
local-storageapple-watchwatchos

How can you calculate available storage space in the Apple Watch?


I've been trying to find a workable solution to determine if I have room to allocate an array of files to the Apple Watch before I attempt any file transfer at all, and I've come up with nothing so far. Any help would be amazing!


Solution

  • NSFileManager works the same way for the Apple Watch as it does on other devices.

    In Objective-C:

    [[[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil] objectForKey:NSFileSystemFreeSize]