如何確定當前的iPhone/設備模型?是否有辦法在SWIFT中獲取設備型號名稱(iPhone4S、iPhone 5、iPhone5S等)?我知道有個財產叫UIDevice.currentDevice().model但它只返回設備類型(iPodtouch、iPhone、iPad、iPhone模擬器等)。我也知道,在目標C中,用這種方法可以很容易地做到這一點:#import <sys/utsname.h>struct utsname systemInfo;uname(&systemInfo);NSString* deviceModel = [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];但是我正在用SWIFT開發我的iPhone應用程序,所以有人能幫我用SWIFT解決這個問題嗎?
- 3 回答
- 0 關注
- 1196 瀏覽
添加回答
舉報
0/150
提交
取消