Latest 0.1.0
Homepage https://github.com/jack3010/ResolutionChecker
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

Apple Devices Resolutions Checker

Build Status
Version
License
Platform
ResolutionChecker
ResolutionChecker
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

  • [x] 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.

Latest podspec

{
    "name": "ResolutionChecker",
    "version": "0.1.0",
    "summary": "A simple Resolution Checker for iOS.",
    "description": "Resolution Checker for iOS",
    "homepage": "https://github.com/jack3010/ResolutionChecker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "TA-CUONG NGUYE": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/jack3010/ResolutionChecker.git",
        "tag": "0.1.0"
    },
    "source_files": "Source",
    "frameworks": "UIKit",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This