GithubHelp home page GithubHelp logo

anthonymyatt / uidevicemodelname Goto Github PK

View Code? Open in Web Editor NEW

This project forked from katsuyax/uidevicemodelname

1.0 1.0 0.0 14 KB

Extention of UIDevice to get the model name of the iOS devices

License: MIT License

Swift 91.25% Ruby 8.75%

uidevicemodelname's Introduction

Installation

Requires Swift 4/5 and Xcode 10.x

Swift Package Manager

Add the project as a dependency to your Package.swift

// swift-tools-version:4.2

import PackageDescription

let package = Package(
    name: "uidevicemodelname-test",
    products: [
        .executable(name: "uidevicemodelname-test", targets: ["YourTargetName"])
    ],
    dependencies: [
        .package(url: "http://github.com/anthonymyatt/uidevicemodelname", .upToNextMinor(from: "1.1.3"))
    ],
    targets: [
        .target(name: "YourTargetName", dependencies: ["UIDeviceModelName"], path: "./Path/To/Your/Sources")
    ]
)

Then import import UIDeviceModelName.

Cocoapods

Create Podfile and add pod 'UIDeviceModelName':

use_frameworks!
target 'YourApp' do
    pod 'UIDeviceModelName', '~> 1.1.3'
end

Install pods:

$ pod install

Import the module:

import UIDeviceModelName

Usage

import UIDeviceModelName

print(UIDevice.current.modelName) // ex) iPhone 8 , iPhone 8 Plus ...

Supported devices

  • iPhone 3GS
  • iPhone 4 / 4S
  • iPhone 5 / 5s / 5c
  • iPhone 6 / 6 Plus / 6s / 6 Plus
  • iPhone 7 / 7 Plus
  • iPhone SE
  • iPhone 8 / 8 Plus
  • iPhone X
  • iPhone XS / XS Max
  • iPhone XR
  • iPad 1 / 2 / 3 / 4 / 5 / 6
  • iPad Air / Air2
  • iPad Pro 1 (12.9 / 10.5 / 9.7-inch)
  • iPad Pro 2 / 3 (12.9-inch)
  • iPad Pro 3 (11-inch)
  • iPad mini / mini 2 / mini 3 / mini 4
  • iPod touch / 2G / 3G / 4G / 5G / 6G
  • Apple TV 4
  • Apple TV 4K
  • Apple Watch 0 / 1 / 2 / 3 (38 / 42mm)
  • Apple Watch 4 (40 / 44mm)

License

UIDeviceModelName is available under the MIT license. See the LICENSE file for more info.

uidevicemodelname's People

Contributors

katsuyax avatar

Stargazers

AnthonyMyatt.Net avatar

Watchers

James Cloos 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.