Giter VIP home page Giter VIP logo

resolutionchecker's Introduction

Apple Devices Resolutions Checker

Build Status Version License Platform Carthage compatible

Easy to detect iOS device or version in your code

Features

Requirements

  • iOS 9.0+
  • Xcode 9
  • Swift 4

Installation

ResolutionChecker can be installed in various ways.

Cocoapods

pod 'ResolutionChecker'

Carthage

github "jack3010/ResolutionChecker" ~> 0.1.0

Manually

To install manually drag and drop ResolutionChecker into your project in Xcode or add it as a submodule.In your project folder enter:

$ git submodule add https://github.com/jack3010/ResolutionChecker.git

Check screen orientation

If you want to check status of device when the device rotate. You can type a command:

override func viewDidLoad() {
   super.viewDidLoad()
   // Check status of screen orientation
   print(String(Device.isLandscape))
}

The command Device.isLandscape will return Bool value

Detect device type

Device resolution checker helps you detect what kind of device is running app.

Device.type.rawValue

Output: iPhone

Detect device version

You also want to detect exact version like iPhone6, iPhone6 Plus,..etc. Type the command:

Device.version.rawValue

Check iPhone/iPad/Simulator

Device.isIphone
Device.isPad
Device.isPadPro10_5
Device.isPadPro12_9
Device.isSimulator
Device.isPhoneX

Detect iOS version

String(describing: Device.iosVersion)

Moreover, you also compare device screen.

if Screen.screen_3_5_inch < Screen.screen_4_0_inch {
   print("true")
}

TO DO NEXT

  • Compare version iOS.

Contributing

If you have the need for a specific feature that you want implemented or if you experienced a bug, please open an issue. If you extended the functionality of ResolutionChecker yourself and want others to use it too, please submit a pull request.

resolutionchecker's People

Contributors

jack3010 avatar

Stargazers

MartinHor avatar Tranld avatar  avatar Cường Nguyễn Tạ avatar khoi avatar Martin avatar Shaw Vu avatar Tan Nguyen avatar Ngo Huu Tuan avatar

Watchers

James Cloos avatar Tan Nguyen avatar Cường Nguyễn Tạ 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.