// // UIDevice+UIDeviceEX.h // QQMSFContact // // Created by zheng bingchao on 13-8-17. // // #import #define IFPGA_NAMESTRING @"iFPGA" #define IPHONE_UNKNOWN_NAMESTRING @"Unknown iPhone" #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_5S_NAMESTRING @"iPhone 5S" #define IPHONE_6_NAMESTRING @"iPhone 6" #define IPHONE_6PLUS_NAMESTRING @"iPhone 6Plus" #define IPHONE_6S_NAMESTRING @"iPhone 6s" #define IPHONE_6SPlus_NAMESTRING @"iPhone 6sPlus" #define IPHONE_7_NAMESTRING @"iPhone 7" #define IPHONE_7Plus_NAMESTRING @"iPhone 7Plus" #define IPHONE_8_NAMESTRING @"iPhone 8" #define IPHONE_8Plus_NAMESTRING @"iPhone 8Plus" #define IPHONE_X_NAMESTRING @"iPhone X" #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_5G_NAMESTRING @"iPod touch 5G" #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 NS_ENUM(NSInteger, UIDevicePlatform) { UIDeviceUnknown, UIDeviceSimulator, UIDeviceSimulatoriPhone, UIDeviceSimulatoriPad, UIDeviceSimulatorAppleTV, UIDevice1GiPhone, UIDevice3GiPhone, UIDevice3GSiPhone, UIDevice4iPhone, UIDevice4SiPhone, UIDevice5iPhone, UIDevice5SiPhone, UIDevice6Plus, UIDevice6, UIDevice6SiPhone, UIDevice6SPlus, UIDeviceSE, UIDevice7iPhone, UIDevice7Plus, UIDevice8iPhone, UIDevice8Plus, UIDeviceXiPhone, UIDevice1GiPod, UIDevice2GiPod, UIDevice3GiPod, UIDevice4GiPod, UIDevice5GiPod, UIDevice1GiPad, UIDevice2GiPad, UIDevice3GiPad, UIDevice4GiPad, UIDeviceAppleTV2, UIDeviceAppleTV3, UIDeviceAppleTV4, UIDeviceUnknowniPhone, UIDeviceUnknowniPod, UIDeviceUnknowniPad, UIDeviceUnknownAppleTV, UIDeviceIFPGA, }; typedef NS_ENUM(NSInteger, UIDeviceFamily) { UIDeviceFamilyiPhone, UIDeviceFamilyiPod, UIDeviceFamilyiPad, UIDeviceFamilyAppleTV, UIDeviceFamilyUnknown, }; typedef NS_ENUM(NSInteger, UIDeviceBiologyIDType) { UIDeviceBiologyIDTypeNone, // 没有生物学ID UIDeviceBiologyIDTypeTouchID, // 支持TouchID UIDeviceBiologyIDTypeFaceID // 支持FaceID }; @interface UIDevice (Hardware) //设备平台 - (NSString *)platform; //设备平台类型 - (NSUInteger)platformType; //设备平台字符串 - (NSString *)platformString; //设备所属平台家族 - (UIDeviceFamily)deviceFamily; //设备总内存 - (NSUInteger)totalMemory; //设备磁盘总大小 - (NSNumber *)totalDiskSpace; //设备磁盘空闲大小 - (NSNumber *)freeDiskSpace; //设备MAC地址 - (NSString *)macaddress; //设备IP地址 - (NSString *)currentIPAddress; @end