Determine device (iPhone, iPod Touch) with iOS

后端 未结 30 1745
礼貌的吻别
礼貌的吻别 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 12:01

    Dutchie432 and Brian Robbins have provided great solutions. But there's still one model missing, the Verizon iPhone 4. Here's the missing line.

    if ([platform isEqualToString:@"iPhone3,2"])    return @"iPhone 4"; //Verizon
    

提交回复
热议问题