Determine device (iPhone, iPod Touch) with iOS

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

    There's a pretty mature library (by me) for that called SDVersion. You can check for running device's model, screen size and many other parameters. It also supports OSX.

    Example:

          // Check for device model
          if ([SDVersion deviceVersion] == iPhone6)
               NSLog(@"You got the iPhone 6. Sweet 

提交回复
热议问题