Giter Site home page Giter Site logo

paulz / uideviceidentifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from squarefrog/uideviceidentifier

0.0 0.0 0.0 52 KB

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

License: MIT License

Ruby 5.83% Objective-C 85.19% Swift 8.98%

uideviceidentifier's Introduction

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.

uideviceidentifier's People

Contributors

squarefrog avatar coeur avatar mangerlahn avatar cabbiepete avatar kawanet avatar bjhomer avatar arfaoui avatar chenpingsheng avatar mflint avatar maxhasadhd avatar readmecritic avatar rgomesbr avatar stevemoser avatar silviasfondrini avatar stevel6868 avatar lefex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.