Open Source iOS Library For Easily Detecting Screen Size And Device Names

Last week I mentioned an iOS library that allows you to grab the hardware name of the current iOS device which has become very important with all the different iOS devices out there and the different screen sizes available.

Here’s an open source library created for the same purpose called SDiPhoneVersion from Sebastian Dobrincu that takes things to another level with screen size information also included. With SDiPhoneVersion you can easily check the device model, screen size, and device name.

Here is a code snippet from the readme showing how to use the different capabilities of SDiPhoneVersion:


      //Check for device model
      if ([SDiPhoneVersion deviceVersion] == iPhone6)
           NSLog(@"You got the new iPhone 6. Nice!");
      else if ([SDiPhoneVersion deviceVersion] == iPhone6Plus)
           NSLog(@"You got the iPhone 6 Plus. Bigger is better!");

      // Check for device screen size
      if ([SDiPhoneVersion deviceSize] == iPhone4inch)
           NSLog(@"Your screen is 4 inches");

      //Get device name
      NSLog(@"%@",[SDiPhoneVersion deviceName]);
      /* e.g: Outputs 'iPhone6,2' */

You can find SDiPhoneVersion on Github here.\

A nice library for gathering device and screen information.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: Open Source iOS Library For Easily Detecting Screen Size And Device Names

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *