Determine device (iPhone, iPod Touch) with iOS

后端 未结 30 2138
礼貌的吻别
礼貌的吻别 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:04

    You can check GBDeviceInfo on GitHub, also available via CocoaPods. It provides simple API for detecting various properties with support of all latest devices:

    • Device family

    [GBDeviceInfo deviceDetails].family == GBDeviceFamilyiPhone;

    • Device model

    [GBDeviceInfo deviceDetails].model == GBDeviceModeliPhone6.

    For more see Readme.

提交回复
热议问题