UIDeviceHardware is a class originally created in a gist by Jaybles. It allows querying of the current users device, and returns a human formatted string.
It is written as a class method, to allow use without direct instantiation.
To use this class, copy the class header files, or include the class in your CocoaPods Podfile. Then when you are ready to query the device, simply import the header file and use:
pod 'UIDeviceIdentifier', :git => 'https://github.com/squarefrog/UIDeviceIdentifier.git'
#import <UIDeviceIdentifier/UIDeviceHardware.h>
@implementation MyClass
- (void)myMethod
{
NSString *platformString = [UIDeviceHardware platformString];
NSString *currentDevice = [UIDeviceHardware platformString];
}
@end
UIDeviceHardware is available under the MIT license. See the LICENSE file for more info.