?Swift获取手机设备信息
2015-06-01 15:55
459 查看
使用UiDevice获取设备信息:
获取设备名称
获取设备系统名称
获取系统版本
获取设备模型
获取设备本地模型
Swift获取Bundle的相关信息:
获取设备名称
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 代码分享——Calculator without MVC
- Swift的属性,方法,下标脚本以及继承
- Swift中的设计模式
- swift 点击cell没反应,点击后应该跳到指定页面
- 【swift】15-0601 枚举类型
- The Swift Programming Language - Closures
- Swift & the Objective-C Runtime
- Swift学习笔记-函数和闭包(2)
- Swift学习笔记-函数和闭包(1)
- 获取当前时间 swift
- swift 笔记
- Swift学习笔记-判断字符出现的次数
- Swift面向对象-枚举
- 【swift】15-0530 闭包
- 【swift】15-0529 In-Out参数 函数类型
- Swift开发教程--实现UITableView报错does not conform to protocol 'UITableViewDataSource‘
- 从0开始学习Swift开发IOS应用(5)——Button
- KeyStone安装部署笔记
- 从0开始学习Swift开发IOS应用(4)——Navigation Controller
- 对象存储系统Swift官方文档