Determine device (iPhone, iPod Touch) with iOS

后端 未结 30 2266
礼貌的吻别
礼貌的吻别 2020-11-21 11:29

Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch, if possible.

30条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-21 11:52

    NSString *deviceType = [[UIDevice currentDevice] systemName];
    

    I can assure that the above suggested one will work in iOS 7 and above. I believe it will work in iOS 6 too. But am not sure about that.

提交回复
热议问题