Latest 0.0.1
Homepage https://github.com/976431yang/YQDeviceInfo
License MIT
Platforms ios 8.0
Authors

iOS Device Infomation,like model,ios version,battery level,cpu,memory

iOS端 获取设备信息的简单封装
  • 直接拖到工程中使用,或者pod ‘YQDeviceInfo’

Example Code:

设备型号:
    NSString *modelSimple = [YQDeviceInfo getDeviceNameWithDetail:NO];
    // "iPhone 7"
    NSLog(@"%@",modelSimple);

    NSString *modelFull = [YQDeviceInfo getDeviceNameWithDetail:YES];
    // "iPhone 7 美版、台版"
    NSLog(@"%@",modelFull);
系统版本:
    NSString *iOSVersion = [YQDeviceInfo getIOSVersion];
    // "iOSVersion : 11.1.2"
    NSLog(@"iOSVersion : %@",iOSVersion);
App版本 & Build:
    NSString *AppVersion = [YQDeviceInfo getAppVersion];
    // "AppVersion : 1.0"
    NSLog(@"AppVersion : %@",AppVersion);

    NSString *AppBuild = [YQDeviceInfo getAppBuild];
    // "AppBuild : 1"
    NSLog(@"AppBuild : %@",AppBuild);
电量:
    CGFloat bettaryLevel = [YQDeviceInfo getBettaryLevel];
    // "bettary : 25%"
    NSLog(@"bettary : %.0f%%",bettaryLevel*100);
运行内存:
    CGFloat memoryUse = [YQDeviceInfo getUsedMemoryInMB];
    // "memory use : 24.8 mb"
    NSLog(@"memory use : %f mb",memoryUse);
CPU:
    CGFloat cpuUse = [YQDeviceInfo getCpuUsage];
    // "cpu use : 12.56%";
    NSLog(@"cpu use : %.2f%%",cpuUse);

Latest podspec

{
    "name": "YQDeviceInfo",
    "version": "0.0.1",
    "summary": "iOS u8bbeu5907u4fe1u606f u578bu53f7u3001u7248u672cu3001u7535u91cfu3001cpuu3001u5185u5b58u7b49",
    "homepage": "https://github.com/976431yang/YQDeviceInfo",
    "license": "MIT",
    "authors": {
        "FreakyYang": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/976431yang/YQDeviceInfo.git",
        "tag": "0.0.1"
    },
    "public_header_files": "YQDeviceInfo/**/*.{h}",
    "source_files": "YQDeviceInfo/**/*.{h,m,mm}"
}

Pin It on Pinterest

Share This