• Stars
    star
    241
  • Rank 167,643 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 12 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

UIDeviceHardware is a class which allows querying of the current users device, and returns a human formatted string.

Description

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.

⚠️ Note

I don't use this helper much anymore, so I'm not keeping up to date with device models. While I welcome Pull Requests to update the model, I'd recommend moving over to something more modern, like DeviceKit.

Usage

// "iPhone 5C (GSM)"
NSString *platformString = [UIDeviceHardware platformString];
    
// "iPhone 5C"
NSString *simpleString = [UIDeviceHardware platformStringSimple];

Installation

This class can be installed with Swift Package Manager, Cocoapods, or by directly copying the files into your source code.

Swift Package Manager

Add the package to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/squarefrog/UIDeviceIdentifier", .upToNextMajor(from: "1.7.0"))
],

Then import as follows:

// ObjC
@import UIDeviceIdentifier;
// Swift
import UIDeviceIdentifier

Cocoapods

Add the cocoapod to your Podfile:

pod 'UIDeviceIdentifier', :git => 'https://github.com/squarefrog/UIDeviceIdentifier.git'

Import the file into your Objective-C file:

// ObjC
#import <UIDeviceIdentifier/UIDeviceHardware.h>

Copying the files

Copy UIDeviceHardware.{h/m} into your project. Then just import the header:

#import "UIDeviceHardware.h"

Licence

UIDeviceHardware is available under the MIT licence. See the LICENCE file for more info.

More Repositories

1

strimmer

An Xcode 8 Source Editor Extension to strip whitespace from the current file.
Swift
28
star
2

teensy-midi-encoder-box

A 16 encoder MIDI controller based on the Teensy Arduino platform
C++
21
star
3

UIColor-ContrastColor

Returns either black or white based on the contrast against the current color
Objective-C
14
star
4

UIImage-ColorFromImage

Returns a UIColor from a UIImage
Objective-C
8
star
5

dotfiles

A collection of my Vim and zsh files
Shell
7
star
6

dark-mode-toggle

Animate toggling dark mode on iOS
Swift
6
star
7

led-controller-software

Allow control of an LED strip wirelessly, using a web API.
C++
5
star
8

tomorrow-night.vim

A tomorrow night theme created for use with NeoBundle
Vim Script
4
star
9

mcp23s17-breakout-board

A 30x40mm breakout board for the MCP23S17 SOIC package.
Eagle
3
star
10

plex-refresh

A small Node application to act as a web hook for starting Plex Media Scanner.
JavaScript
2
star
11

scaletor

Generate modal scales in a type-safe way using Swift
Swift
2
star
12

teensy-mcp23s17-mainboard

A breakout PCB for linking the Teensy 3.2 with 3x MCP23S17 SOIC packages.
Eagle
2
star
13

photoshop-grid-toggle

A script for toggling visibility on a grid layer set
JavaScript
2
star
14

zsh-carthage

A very, very tiny Carthage plugin for zsh.
Shell
1
star
15

enigma

An Enigma machine emulator written in Swift
Swift
1
star
16

XcodeVim

1
star
17

Weathr

Objective-C
1
star
18

SQFInMemoryContext

Quickly and easily create an in-memory context for Unit Testing Core Data entities.
Objective-C
1
star
19

teensy-spi-breakout

Teensy 3.2 SPI breakout board
Eagle
1
star
20

midi-footswitch

A Bluetooth MIDI Footswitch
Arduino
1
star
21

TraktTopTen

An example Swift application that uses the Trakt API
Swift
1
star
22

homebridge-led-controller

Homebridge ESP LED Controller
JavaScript
1
star
23

fastlane-exit-codes

Sample project to test Fastlane exit codes
Swift
1
star