首页 > 移动平台 > 详细

?Swift获取手机设备信息

时间:2015-06-01 16:11:04      阅读:276      评论:0      收藏:0      [点我收藏+]

使用UiDevice获取设备信息:

获取设备名称

let name = UIDevice.currentDevice().name

获取设备系统名称

let systemName = UIDevice.currentDevice().systemName

获取系统版本

let systemVersion = UIDevice.currentDevice().systemVersion

获取设备模型

let model = UIDevice.currentDevice().model

获取设备本地模型

let localizedModel = UIDevice.currentDevice().localizedModel

 

Swift获取Bundle的相关信息:

技术分享
let infoDict = NSBundle.mainBundle().infoDictionary
if let info = infoDict? {
    // app名称
    let appName = info["CFBundleName"] as String!
    // app版本
    let appVersion = info["CFBundleShortVersionString"] as String!
    // app build版本
    let appBuild = info["CFBundleVersion"] as String!
}

?Swift获取手机设备信息

原文:http://www.cnblogs.com/yaosuc/p/4544139.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!