Get Updates By E-mail 

Article Written By:
Johann Dowa

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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments