如何判断iOS设备型号,比如iPhone5.
现在我的做法是写了个宏:
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
API中直接有方法可以调用吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
历史上是这样的
The Answer http://stackoverflow.com/questions/11...
为什么要判断设备型号?如果是为了适应不同分辨率的需求,我是拿屏幕尺寸
如果是装逼型需求,比如“用户通过iPhone5分享”,试试
iPhone2,1 3GS
iPhone3,1 4
iPhone3,3 4 CDMA
iPhone4,1 4s 猜的
iPhone5,1 5 猜的