Query Available iOS Disk Space with Swift
问题 I'm trying to get the available iOS device storage using Swift . I found this function here func deviceRemainingFreeSpaceInBytes() -> NSNumber { let documentDirectoryPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) let systemAttributes = NSFileManager.defaultManager().attributesOfFileSystemForPath(documentDirectoryPath.last as String, error: nil) return systemAttributes[NSFileSystemFreeSize] as NSNumber } But at compile time this error is given: [NSObject