iPhone的设备名转换
Posted xiyuan2016
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iPhone的设备名转换相关的知识,希望对你有一定的参考价值。
def convertDeviceName(self, deviceName): """ 转换deviceName(如iPhone 6,2)为用户习惯形式(如iPhone 5s) """ if deviceName == [‘iPhone5,1‘, ‘iPhone5,2‘]: deviceName_new = ‘iPhone 5‘ return deviceName_new elif deviceName in [‘iPhone5,3‘, ‘iPhone5,4‘]: deviceName_new = ‘iPhone 5C‘ return deviceName_new elif deviceName in [‘iPhone6,1‘, ‘iPhone6,2‘]: deviceName_new = ‘iPhone 5s‘ return deviceName_new elif deviceName in [‘iPhone7,1‘]: deviceName_new = ‘iPhone 6 Plus‘ return deviceName_new elif deviceName in [‘iPhone7,2‘]: deviceName_new = ‘iPhone 6‘ return deviceName_new elif deviceName in [‘iPhone8,1‘]: deviceName_new = ‘iPhone 6s‘ return deviceName_new elif deviceName in [‘iPhone8,2‘]: deviceName_new = ‘iPhone 6s Plus‘ return deviceName_new elif deviceName in [‘iPhone8,4‘]: deviceName_new = ‘iPhone SE‘ return deviceName_new elif deviceName in [‘iPhone9,1‘, ‘iPhone9,3‘]: deviceName_new = ‘iPhone 7‘ return deviceName_new elif deviceName in [‘iPhone9,2‘, ‘iPhone9,4‘]: deviceName_new = ‘iPhone 7 Plus‘ return deviceName_new elif deviceName in [‘iPhone10,1‘, ‘iPhone10,4‘]: deviceName_new = ‘iPhone 8‘ return deviceName_new elif deviceName in [‘iPhone10,2‘, ‘iPhone10,5‘]: deviceName_new = ‘iPhone 8 Plus‘ return deviceName_new elif deviceName in [‘iPhone10,3‘, ‘iPhone10,6‘]: deviceName_new = ‘iPhone X‘ return deviceName_new else: raise ValueError(u‘未识别的手机版本‘)
以上是关于iPhone的设备名转换的主要内容,如果未能解决你的问题,请参考以下文章
为何我的iPhone和ipad的airdrop设备名显示的是我朋友的名字
iphone / Objective c的最佳代码片段网站是啥[重复]
为何我的iPhone和ipad的airdrop设备名显示的是我朋友的名字