diff --git a/TCBlobDownload/Docs/TCBlobDownloadDocset.zip b/TCBlobDownload/Docs/TCBlobDownloadDocset.zip index de14c4b1..020d05e6 100644 Binary files a/TCBlobDownload/Docs/TCBlobDownloadDocset.zip and b/TCBlobDownload/Docs/TCBlobDownloadDocset.zip differ diff --git a/TCBlobDownload/TCBlobDownload.xcodeproj/project.pbxproj b/TCBlobDownload/TCBlobDownload.xcodeproj/project.pbxproj index 75fb9be0..d3402553 100644 --- a/TCBlobDownload/TCBlobDownload.xcodeproj/project.pbxproj +++ b/TCBlobDownload/TCBlobDownload.xcodeproj/project.pbxproj @@ -38,9 +38,6 @@ C30D071318C375FB00D5CBB3 /* TCBlobDownloadTestsBase.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D071218C375FB00D5CBB3 /* TCBlobDownloadTestsBase.m */; }; C30D071618C3772F00D5CBB3 /* TCBlobDownloadManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D071518C3772F00D5CBB3 /* TCBlobDownloadManagerTests.m */; }; C30D071918C380BB00D5CBB3 /* TCBlobDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = C30D071818C380BB00D5CBB3 /* TCBlobDownload.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C317CBD918CB69DB00160ED6 /* UIDevice-Hardware.h in Headers */ = {isa = PBXBuildFile; fileRef = C317CBD718CB69DB00160ED6 /* UIDevice-Hardware.h */; }; - C317CBDA18CB69DB00160ED6 /* UIDevice-Hardware.m in Sources */ = {isa = PBXBuildFile; fileRef = C317CBD818CB69DB00160ED6 /* UIDevice-Hardware.m */; }; - C3F05BC9191C98B900002575 /* UIDevice-Hardware.m in Sources */ = {isa = PBXBuildFile; fileRef = C317CBD818CB69DB00160ED6 /* UIDevice-Hardware.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -85,8 +82,6 @@ C30D071218C375FB00D5CBB3 /* TCBlobDownloadTestsBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TCBlobDownloadTestsBase.m; sourceTree = ""; }; C30D071518C3772F00D5CBB3 /* TCBlobDownloadManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TCBlobDownloadManagerTests.m; sourceTree = ""; }; C30D071818C380BB00D5CBB3 /* TCBlobDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TCBlobDownload.h; path = TCBlobDownload/TCBlobDownload.h; sourceTree = ""; }; - C317CBD718CB69DB00160ED6 /* UIDevice-Hardware.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice-Hardware.h"; sourceTree = ""; }; - C317CBD818CB69DB00160ED6 /* UIDevice-Hardware.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice-Hardware.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -141,7 +136,6 @@ 2177620E172FFBD9001956C7 /* TCBlobDownloader.m */, 2177620F172FFBD9001956C7 /* TCBlobDownloadManager.h */, 21776210172FFBD9001956C7 /* TCBlobDownloadManager.m */, - C30D076118C398FF00D5CBB3 /* Categories */, 21776221172FFE8F001956C7 /* Supporting Files */, 21203ADA178C593900C19335 /* TCBlobDownloadTests */, 217761FE172FFBBB001956C7 /* Frameworks */, @@ -185,16 +179,6 @@ name = Base; sourceTree = ""; }; - C30D076118C398FF00D5CBB3 /* Categories */ = { - isa = PBXGroup; - children = ( - C317CBD718CB69DB00160ED6 /* UIDevice-Hardware.h */, - C317CBD818CB69DB00160ED6 /* UIDevice-Hardware.m */, - ); - name = Categories; - path = TCBlobDownload/Categories; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -206,7 +190,6 @@ 21776215172FFC56001956C7 /* TCBlobDownloader.h in Headers */, 21776214172FFC4A001956C7 /* TCBlobDownloadManager.h in Headers */, 21776220172FFE64001956C7 /* TCBlobDownload-Prefix.pch in Headers */, - C317CBD918CB69DB00160ED6 /* UIDevice-Hardware.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -315,7 +298,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C3F05BC9191C98B900002575 /* UIDevice-Hardware.m in Sources */, C30D071618C3772F00D5CBB3 /* TCBlobDownloadManagerTests.m in Sources */, 21203AED178C63AE00C19335 /* TCBlobDownloader.m in Sources */, 21D06E281818539500CAADCD /* DownloadFailureTests.m in Sources */, @@ -331,7 +313,6 @@ files = ( 21776211172FFBD9001956C7 /* TCBlobDownloader.m in Sources */, 21776212172FFBD9001956C7 /* TCBlobDownloadManager.m in Sources */, - C317CBDA18CB69DB00160ED6 /* UIDevice-Hardware.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.h b/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.h deleted file mode 100755 index 261229bf..00000000 --- a/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - Erica Sadun, http://ericasadun.com - iPhone Developer's Cookbook, 6.x Edition - BSD License, Use at your own risk - */ - -#import - -#define IFPGA_NAMESTRING @"iFPGA" - -#define IPHONE_1G_NAMESTRING @"iPhone 1G" -#define IPHONE_3G_NAMESTRING @"iPhone 3G" -#define IPHONE_3GS_NAMESTRING @"iPhone 3GS" -#define IPHONE_4_NAMESTRING @"iPhone 4" -#define IPHONE_4S_NAMESTRING @"iPhone 4S" -#define IPHONE_5_NAMESTRING @"iPhone 5" -#define IPHONE_UNKNOWN_NAMESTRING @"Unknown iPhone" - -#define IPOD_1G_NAMESTRING @"iPod touch 1G" -#define IPOD_2G_NAMESTRING @"iPod touch 2G" -#define IPOD_3G_NAMESTRING @"iPod touch 3G" -#define IPOD_4G_NAMESTRING @"iPod touch 4G" -#define IPOD_UNKNOWN_NAMESTRING @"Unknown iPod" - -#define IPAD_1G_NAMESTRING @"iPad 1G" -#define IPAD_2G_NAMESTRING @"iPad 2G" -#define IPAD_3G_NAMESTRING @"iPad 3G" -#define IPAD_4G_NAMESTRING @"iPad 4G" -#define IPAD_UNKNOWN_NAMESTRING @"Unknown iPad" - -#define APPLETV_2G_NAMESTRING @"Apple TV 2G" -#define APPLETV_3G_NAMESTRING @"Apple TV 3G" -#define APPLETV_4G_NAMESTRING @"Apple TV 4G" -#define APPLETV_UNKNOWN_NAMESTRING @"Unknown Apple TV" - -#define IOS_FAMILY_UNKNOWN_DEVICE @"Unknown iOS device" - -#define SIMULATOR_NAMESTRING @"iPhone Simulator" -#define SIMULATOR_IPHONE_NAMESTRING @"iPhone Simulator" -#define SIMULATOR_IPAD_NAMESTRING @"iPad Simulator" -#define SIMULATOR_APPLETV_NAMESTRING @"Apple TV Simulator" // :) - -typedef enum { - UIDeviceUnknown, - - UIDeviceSimulator, - UIDeviceSimulatoriPhone, - UIDeviceSimulatoriPad, - UIDeviceSimulatorAppleTV, - - UIDevice1GiPhone, - UIDevice3GiPhone, - UIDevice3GSiPhone, - UIDevice4iPhone, - UIDevice4SiPhone, - UIDevice5iPhone, - - UIDevice1GiPod, - UIDevice2GiPod, - UIDevice3GiPod, - UIDevice4GiPod, - - UIDevice1GiPad, - UIDevice2GiPad, - UIDevice3GiPad, - UIDevice4GiPad, - - UIDeviceAppleTV2, - UIDeviceAppleTV3, - UIDeviceAppleTV4, - - UIDeviceUnknowniPhone, - UIDeviceUnknowniPod, - UIDeviceUnknowniPad, - UIDeviceUnknownAppleTV, - UIDeviceIFPGA, - -} UIDevicePlatform; - -typedef enum { - UIDeviceFamilyiPhone, - UIDeviceFamilyiPod, - UIDeviceFamilyiPad, - UIDeviceFamilyAppleTV, - UIDeviceFamilyUnknown, - -} UIDeviceFamily; - -@interface UIDevice (Hardware) -- (NSString *) platform; -- (NSString *) hwmodel; -- (NSUInteger) platformType; -- (NSString *) platformString; - -- (NSUInteger) cpuFrequency; -- (NSUInteger) busFrequency; -- (NSUInteger) cpuCount; -- (NSUInteger) totalMemory; -- (NSUInteger) userMemory; - -- (NSNumber *) totalDiskSpace; -- (NSNumber *) freeDiskSpace; - -- (NSString *) macaddress; - -- (BOOL) hasRetinaDisplay; -- (UIDeviceFamily) deviceFamily; -@end \ No newline at end of file diff --git a/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.m b/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.m deleted file mode 100755 index 07c033fd..00000000 --- a/TCBlobDownload/TCBlobDownload/Categories/UIDevice-Hardware.m +++ /dev/null @@ -1,311 +0,0 @@ -/* - Erica Sadun, http://ericasadun.com - iPhone Developer's Cookbook, 6.x Edition - BSD License, Use at your own risk - */ - -// Thanks to Emanuele Vulcano, Kevin Ballard/Eridius, Ryandjohnson, Matt Brown, etc. - -#include // Per msqr -#include -#include -#include - -#import "UIDevice-Hardware.h" - -@implementation UIDevice (Hardware) -/* - Platforms - - iFPGA -> ?? - - iPhone1,1 -> iPhone 1G, M68 - iPhone1,2 -> iPhone 3G, N82 - iPhone2,1 -> iPhone 3GS, N88 - iPhone3,1 -> iPhone 4/AT&T, N89 - iPhone3,2 -> iPhone 4/Other Carrier?, ?? - iPhone3,3 -> iPhone 4/Verizon, TBD - iPhone4,1 -> (iPhone 4S/GSM), TBD - iPhone4,2 -> (iPhone 4S/CDMA), TBD - iPhone4,3 -> (iPhone 4S/???) - iPhone5,1 -> iPhone Next Gen, TBD - iPhone5,1 -> iPhone Next Gen, TBD - iPhone5,1 -> iPhone Next Gen, TBD - - iPod1,1 -> iPod touch 1G, N45 - iPod2,1 -> iPod touch 2G, N72 - iPod2,2 -> Unknown, ?? - iPod3,1 -> iPod touch 3G, N18 - iPod4,1 -> iPod touch 4G, N80 - - // Thanks NSForge - iPad1,1 -> iPad 1G, WiFi and 3G, K48 - iPad2,1 -> iPad 2G, WiFi, K93 - iPad2,2 -> iPad 2G, GSM 3G, K94 - iPad2,3 -> iPad 2G, CDMA 3G, K95 - iPad3,1 -> (iPad 3G, WiFi) - iPad3,2 -> (iPad 3G, GSM) - iPad3,3 -> (iPad 3G, CDMA) - iPad4,1 -> (iPad 4G, WiFi) - iPad4,2 -> (iPad 4G, GSM) - iPad4,3 -> (iPad 4G, CDMA) - - AppleTV2,1 -> AppleTV 2, K66 - AppleTV3,1 -> AppleTV 3, ?? - - i386, x86_64 -> iPhone Simulator -*/ - - -#pragma mark sysctlbyname utils -- (NSString *) getSysInfoByName:(char *)typeSpecifier -{ - size_t size; - sysctlbyname(typeSpecifier, NULL, &size, NULL, 0); - - char *answer = malloc(size); - sysctlbyname(typeSpecifier, answer, &size, NULL, 0); - - NSString *results = [NSString stringWithCString:answer encoding: NSUTF8StringEncoding]; - - free(answer); - return results; -} - -- (NSString *) platform -{ - return [self getSysInfoByName:"hw.machine"]; -} - - -// Thanks, Tom Harrington (Atomicbird) -- (NSString *) hwmodel -{ - return [self getSysInfoByName:"hw.model"]; -} - -#pragma mark sysctl utils -- (NSUInteger) getSysInfo: (uint) typeSpecifier -{ - size_t size = sizeof(int); - int results; - int mib[2] = {CTL_HW, typeSpecifier}; - sysctl(mib, 2, &results, &size, NULL, 0); - return (NSUInteger) results; -} - -- (NSUInteger) cpuFrequency -{ - return [self getSysInfo:HW_CPU_FREQ]; -} - -- (NSUInteger) busFrequency -{ - return [self getSysInfo:HW_BUS_FREQ]; -} - -- (NSUInteger) cpuCount -{ - return [self getSysInfo:HW_NCPU]; -} - -- (NSUInteger) totalMemory -{ - return [self getSysInfo:HW_PHYSMEM]; -} - -- (NSUInteger) userMemory -{ - return [self getSysInfo:HW_USERMEM]; -} - -- (NSUInteger) maxSocketBufferSize -{ - return [self getSysInfo:KIPC_MAXSOCKBUF]; -} - -#pragma mark file system -- Thanks Joachim Bean! - -/* - extern NSString *NSFileSystemSize; - extern NSString *NSFileSystemFreeSize; - extern NSString *NSFileSystemNodes; - extern NSString *NSFileSystemFreeNodes; - extern NSString *NSFileSystemNumber; -*/ - -- (NSNumber *) totalDiskSpace -{ - NSDictionary *fattributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil]; - return [fattributes objectForKey:NSFileSystemSize]; -} - -- (NSNumber *) freeDiskSpace -{ - NSDictionary *fattributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil]; - return [fattributes objectForKey:NSFileSystemFreeSize]; -} - -#pragma mark platform type and name utils -- (NSUInteger) platformType -{ - NSString *platform = [self platform]; - - // The ever mysterious iFPGA - if ([platform isEqualToString:@"iFPGA"]) return UIDeviceIFPGA; - - // iPhone - if ([platform isEqualToString:@"iPhone1,1"]) return UIDevice1GiPhone; - if ([platform isEqualToString:@"iPhone1,2"]) return UIDevice3GiPhone; - if ([platform hasPrefix:@"iPhone2"]) return UIDevice3GSiPhone; - if ([platform hasPrefix:@"iPhone3"]) return UIDevice4iPhone; - if ([platform hasPrefix:@"iPhone4"]) return UIDevice4SiPhone; - if ([platform hasPrefix:@"iPhone5"]) return UIDevice5iPhone; - - // iPod - if ([platform hasPrefix:@"iPod1"]) return UIDevice1GiPod; - if ([platform hasPrefix:@"iPod2"]) return UIDevice2GiPod; - if ([platform hasPrefix:@"iPod3"]) return UIDevice3GiPod; - if ([platform hasPrefix:@"iPod4"]) return UIDevice4GiPod; - - // iPad - if ([platform hasPrefix:@"iPad1"]) return UIDevice1GiPad; - if ([platform hasPrefix:@"iPad2"]) return UIDevice2GiPad; - if ([platform hasPrefix:@"iPad3"]) return UIDevice3GiPad; - if ([platform hasPrefix:@"iPad4"]) return UIDevice4GiPad; - - // Apple TV - if ([platform hasPrefix:@"AppleTV2"]) return UIDeviceAppleTV2; - if ([platform hasPrefix:@"AppleTV3"]) return UIDeviceAppleTV3; - - if ([platform hasPrefix:@"iPhone"]) return UIDeviceUnknowniPhone; - if ([platform hasPrefix:@"iPod"]) return UIDeviceUnknowniPod; - if ([platform hasPrefix:@"iPad"]) return UIDeviceUnknowniPad; - if ([platform hasPrefix:@"AppleTV"]) return UIDeviceUnknownAppleTV; - - // Simulator thanks Jordan Breeding - if ([platform hasSuffix:@"86"] || [platform isEqual:@"x86_64"]) - { - BOOL smallerScreen = [[UIScreen mainScreen] bounds].size.width < 768; - return smallerScreen ? UIDeviceSimulatoriPhone : UIDeviceSimulatoriPad; - } - - return UIDeviceUnknown; -} - -- (NSString *) platformString -{ - switch ([self platformType]) - { - case UIDevice1GiPhone: return IPHONE_1G_NAMESTRING; - case UIDevice3GiPhone: return IPHONE_3G_NAMESTRING; - case UIDevice3GSiPhone: return IPHONE_3GS_NAMESTRING; - case UIDevice4iPhone: return IPHONE_4_NAMESTRING; - case UIDevice4SiPhone: return IPHONE_4S_NAMESTRING; - case UIDevice5iPhone: return IPHONE_5_NAMESTRING; - case UIDeviceUnknowniPhone: return IPHONE_UNKNOWN_NAMESTRING; - - case UIDevice1GiPod: return IPOD_1G_NAMESTRING; - case UIDevice2GiPod: return IPOD_2G_NAMESTRING; - case UIDevice3GiPod: return IPOD_3G_NAMESTRING; - case UIDevice4GiPod: return IPOD_4G_NAMESTRING; - case UIDeviceUnknowniPod: return IPOD_UNKNOWN_NAMESTRING; - - case UIDevice1GiPad : return IPAD_1G_NAMESTRING; - case UIDevice2GiPad : return IPAD_2G_NAMESTRING; - case UIDevice3GiPad : return IPAD_3G_NAMESTRING; - case UIDevice4GiPad : return IPAD_4G_NAMESTRING; - case UIDeviceUnknowniPad : return IPAD_UNKNOWN_NAMESTRING; - - case UIDeviceAppleTV2 : return APPLETV_2G_NAMESTRING; - case UIDeviceAppleTV3 : return APPLETV_3G_NAMESTRING; - case UIDeviceAppleTV4 : return APPLETV_4G_NAMESTRING; - case UIDeviceUnknownAppleTV: return APPLETV_UNKNOWN_NAMESTRING; - - case UIDeviceSimulator: return SIMULATOR_NAMESTRING; - case UIDeviceSimulatoriPhone: return SIMULATOR_IPHONE_NAMESTRING; - case UIDeviceSimulatoriPad: return SIMULATOR_IPAD_NAMESTRING; - case UIDeviceSimulatorAppleTV: return SIMULATOR_APPLETV_NAMESTRING; - - case UIDeviceIFPGA: return IFPGA_NAMESTRING; - - default: return IOS_FAMILY_UNKNOWN_DEVICE; - } -} - -- (BOOL) hasRetinaDisplay -{ - return ([UIScreen mainScreen].scale == 2.0f); -} - -- (UIDeviceFamily) deviceFamily -{ - NSString *platform = [self platform]; - if ([platform hasPrefix:@"iPhone"]) return UIDeviceFamilyiPhone; - if ([platform hasPrefix:@"iPod"]) return UIDeviceFamilyiPod; - if ([platform hasPrefix:@"iPad"]) return UIDeviceFamilyiPad; - if ([platform hasPrefix:@"AppleTV"]) return UIDeviceFamilyAppleTV; - - return UIDeviceFamilyUnknown; -} - -#pragma mark MAC addy -// Return the local MAC addy -// Courtesy of FreeBSD hackers email list -// Accidentally munged during previous update. Fixed thanks to mlamb. -- (NSString *) macaddress -{ - int mib[6]; - size_t len; - char *buf; - unsigned char *ptr; - struct if_msghdr *ifm; - struct sockaddr_dl *sdl; - - mib[0] = CTL_NET; - mib[1] = AF_ROUTE; - mib[2] = 0; - mib[3] = AF_LINK; - mib[4] = NET_RT_IFLIST; - - if ((mib[5] = if_nametoindex("en0")) == 0) { - printf("Error: if_nametoindex error\n"); - return NULL; - } - - if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) { - printf("Error: sysctl, take 1\n"); - return NULL; - } - - if ((buf = malloc(len)) == NULL) { - printf("Error: Memory allocation error\n"); - return NULL; - } - - if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { - printf("Error: sysctl, take 2\n"); - free(buf); // Thanks, Remy "Psy" Demerest - return NULL; - } - - ifm = (struct if_msghdr *)buf; - sdl = (struct sockaddr_dl *)(ifm + 1); - ptr = (unsigned char *)LLADDR(sdl); - NSString *outstring = [NSString stringWithFormat:@"%02X:%02X:%02X:%02X:%02X:%02X", *ptr, *(ptr+1), *(ptr+2), *(ptr+3), *(ptr+4), *(ptr+5)]; - - free(buf); - return outstring; -} - -// Illicit Bluetooth check -- cannot be used in App Store -/* -Class btclass = NSClassFromString(@"GKBluetoothSupport"); -if ([btclass respondsToSelector:@selector(bluetoothStatus)]) -{ - printf("BTStatus %d\n", ((int)[btclass performSelector:@selector(bluetoothStatus)] & 1) != 0); - bluetooth = ((int)[btclass performSelector:@selector(bluetoothStatus)] & 1) != 0; - printf("Bluetooth %s enabled\n", bluetooth ? "is" : "isn't"); -} -*/ -@end \ No newline at end of file diff --git a/TCBlobDownload/TCBlobDownload/TCBlobDownloader.m b/TCBlobDownload/TCBlobDownload/TCBlobDownloader.m index eba39df9..baa690c7 100644 --- a/TCBlobDownload/TCBlobDownload/TCBlobDownloader.m +++ b/TCBlobDownload/TCBlobDownload/TCBlobDownloader.m @@ -13,7 +13,6 @@ NSString * const TCBlobDownloadErrorHTTPStatusKey = @"TCBlobDownloadErrorHTTPStatusKey"; #import "TCBlobDownloader.h" -#import "UIDevice-Hardware.h" @interface TCBlobDownloader () // Public @@ -40,6 +39,8 @@ @interface TCBlobDownloader () @property (nonatomic, copy) void (^errorBlock)(NSError *error); @property (nonatomic, copy) void (^completeBlock)(BOOL downloadFinished, NSString *pathToFile); ++ (NSNumber *)freeDiskSpace; + - (void)finishOperationWithState:(TCBlobDownloadState)state; - (void)notifyFromCompletionWithError:(NSError *)error pathToFile:(NSString *)pathToFile; - (void)updateTransferRate; @@ -211,7 +212,7 @@ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLRespons } long long expected = @(self.expectedDataLength).longLongValue; - if ([[UIDevice currentDevice] freeDiskSpace].longLongValue < expected && expected != -1) { + if ([TCBlobDownloader freeDiskSpace].longLongValue < expected && expected != -1) { error = [NSError errorWithDomain:TCBlobDownloadErrorDomain code:TCBlobDownloadErrorNotEnoughFreeDiskSpace userInfo:@{ NSLocalizedDescriptionKey:@"Not enough free disk space" }]; @@ -377,6 +378,12 @@ - (BOOL)removeFileWithError:(NSError *__autoreleasing *)error return YES; } ++ (NSNumber *)freeDiskSpace +{ + NSDictionary *fattributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:nil]; + return [fattributes objectForKey:NSFileSystemFreeSize]; +} + #pragma mark - Custom Getters