Thingy - A modern device detection and querying library.

Overview

Thingy

A modern device detection and querying library.

Build Status GitHub license SPM Carthage compatible codecov

Features

  • Swift 5 support
  • Modern syntax
  • Documentation
  • Device detection
  • Device family detection
  • Device screens
  • Simulator detection
  • Simple querying

Requirements

Installation

Swift Packager Manager (SPM)

Use Xcode 11 to add Thingy as a package or update your Package.swift for manual setups:

import PackageDescription

let package = Package(
    name: "HelloWorld",
    dependencies: [
        .Package(url: "https://github.com/bojan/Thingy.git", "3.0.0")
    ]
)

Carthage

Add this to your Cartfile:

github "bojan/Thingy"

Manually

Add the repository as a submodule to your project.

git submodule add https://github.com/bojan/Thingy.git Vendor/Thingy

Open the newly created folder in Finder and drag Thingy.xcodeproj to your project.

In your project's settings, select your target and under General > Embedded Binaries, add the framework depending on the target OS (iOS, watchOS or tvOS).

Usage

Import the module where needed:

import Thingy

Device properties

Inspect the current device:

let myDevice = Device()

// Compare models or product families
if myDevice.family == .tv {
    print("This is an Apple TV device.")
}

if myDevice.model != .iPhoneXSMax {
    print("This is NOT an iPhone XS Max.")
}

// Pretty printed device properties

print(myDevice.family.marketingName) // e.g. iPad
print(myDevice.model.marketingName) // e.g. iPhone 7 Plus
print(myDevice.productLine.marketingName) // e.g. Air

Model comparison

let myDevice = Device()

do {
    let result = try myDevice.isEqual(to: Thingy.iPadPro12Inch)
}
catch {
    print("The devices are incompatible.")
}

do {
    let result = try myDevice.isOlder(than: Thingy.iPadPro10Inch)
}
catch {
    print("The devices are incompatible.")
}

Device size

let myDevice = Device()

if myDevice.display == .screen10_5Inch {
    print("This is the 10.5in iPad Pro.")
}

Contributions

All contributions and suggestions are welcome and very much appreciated.

Should you have a feature request or a problem that you may experience, feel free to open an issue.

If you are willing to contribute by adding a feature or squashing a bug or two, please submit a pull request.

Author

Bojan Dimovski

License

Thingy is available under the WTFPL license. Check the LICENSE file for more info.

You might also like...
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.

A 3d rotation effect that uses Core Motion to allow SwiftUI views to appear projected in a specific direction and distance relative to the device in r

Modern-collection-view - Modern collection view for swift

Modern collection view Sample application demonstrating the use of collection vi

Simple library to detect motion type (walking, running, automotive) and count users steps. This library will make motion detection much more easily.
Simple library to detect motion type (walking, running, automotive) and count users steps. This library will make motion detection much more easily.

SOMotionDetector Simple library to detect motion for iOS by arturdev . Based on location updates and acceleration. ###Requierments iOS 6.0 Compatibl

Face detection and recognition iOS app with OpenCV
Face detection and recognition iOS app with OpenCV

Facemotion Facemotion it's an iOS app, allowing you to find easily a contact by face recognition. Scan the face of a person, whether the contact is in

Realtime yoga pose detection and classification plugin for Flutter using MLKit

ML Kit Pose Detection Plugin Flutter plugin for realtime pose detection using MLKit's Blazepose. License Copyright (c) 2021 Souvik Biswas, Bharat Bira

:eyes: Face detection and recognition iOS app with OpenCV
:eyes: Face detection and recognition iOS app with OpenCV

Facemotion Facemotion it's an iOS app, allowing you to find easily a contact by face recognition. Scan the face of a person, whether the contact is in

A camera designed in Swift for easily integrating CoreML models - as well as image streaming, QR/Barcode detection, and many other features
A camera designed in Swift for easily integrating CoreML models - as well as image streaming, QR/Barcode detection, and many other features

Would you like to use a fully-functional camera in an iOS application in seconds? Would you like to do CoreML image recognition in just a few more sec

Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks
Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks

mtcnn-caffe Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks. This project provide you a method to update mu

Holistically-Nested Edge Detection (HED) using CoreML and Swift
Holistically-Nested Edge Detection (HED) using CoreML and Swift

HED-CoreML Holistically-Nested Edge Detection (HED) using CoreML and Swift This is the repo for tutorial, that contains an example application that ru

🌐 Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access.
🌐 Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access.

Connectivity is a wrapper for Apple's Reachability providing a reliable measure of whether Internet connectivity is available where Reachability alone

This is a mysic detection app that uses ShazamKit to detect music. O

This is a mysic detection app that uses ShazamKit to detect music. Once it detects the music, it takes the information about that music to find lyrics for that song using a Lyrics API.

Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta)
Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta)

FlutterPianoAudioDetection Plugin Flutter Piano Audio Detection implemented with Tensorflow Lite Model (Google Magenta) Android Implementation iOS/iPa

Dogtector: dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized
Dogtector: dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized

Dogtector Project description Dogtector is dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized for u

Covid-19/Pneumonia Detection Application through Chest Radiographs
Covid-19/Pneumonia Detection Application through Chest Radiographs

CoviScan Covid-19/Pneumonia Detection Application through Chest Radiographs Curr

Simple app install/update behavior detection.

App-Update-Tracker AppUpdateTracker is a simple, lightweight iOS library intended to determine basic app install/update behavior. The following is a l

Fashion Detection in the Wild (Deep Clothes Detector)
Fashion Detection in the Wild (Deep Clothes Detector)

Deep Clothes Detector is a clothes detection framework based on Fast R-CNN. Given a fashion image, this software finds and localizes potential upper-body clothes, lower-body clothes and full-body clothes in it, respectively.

TextDetection-CoreML - This project is Text Detection on iOS using Vision built-in model
TextDetection-CoreML - This project is Text Detection on iOS using Vision built-in model

This project is Text Detection on iOS using Vision built-in model. If you are interested in iOS + Machine Learning, visit here yo

CloneCorp - Data corpus for the evaluation of cross-language clone detection algorithms

CloneCorp - Data corpus for the evaluation of cross-language clone detection algorithms

Annotation - Generate files to train with Object Detection by Create ML
Annotation - Generate files to train with Object Detection by Create ML

CreateML Annotation Generate files to train with Object Detection by Create ML.

Comments
  • Library version 3.0.2 not compiling in Xcode 14

    Library version 3.0.2 not compiling in Xcode 14

    After importing the library through Swift Package manager, Xcode 14 is returning us the following errors:

    Screen Shot 2022-10-05 at 12 16 20

    I suppose the CGSize.zero issues can be solved by importing CoreGraphics but Display needs to explicitly conform Equatable.

    opened by OmarPedraza 0
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 1
Releases(3.0.2)
Super-lightweight library to detect used device

Device.swift Super-lightweight library to detect used device Device.swift extends the UIDevice class by adding a property: var deviceType: DeviceType

Johannes Schickling 219 Nov 17, 2022
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Lucas Ortis 1.5k Dec 28, 2022
Launch JIT enabled iOS app with a second iOS device

Jitterbug This app uses libimobiledevice and WiFi pairing to use one iOS device to launch apps with the debugger on another iOS device. This "tethered

null 645 Jan 6, 2023
Inspect the iOS 15 App Activity Data directly on device.

AppActivityViewer About AppActivityViewer helps to inspect the iOS 15 App Activity Data easily on device. Choose App Activity at share sheet after cli

CJ 15 Mar 30, 2022
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

Andrea Mario Lufino 324 Nov 27, 2022
A Swift library for efficient highlighting, indenting, and querying the structure of language syntax.

Neon A Swift library for efficient highlighting, indenting, and querying the structure of language syntax. It features: Minimal text invalidation Supp

Chime 214 Dec 28, 2022
golf pose detection Analyzing golf pose with MLKit pose detection

golf-pose golf pose detection Analyzing golf pose with MLKit pose detection (PHI NETWORKS, 창의적통합설계, 2021) Standard & Frameworks iOS platform (Swift, R

Donghyun Lee 1 Jan 24, 2022
Effortless emoji-querying in Swift

EmojiKit EmojiKit is a simple emoji-querying framework in Swift. It is used in Paste, an Emoji Search app in the App Store. Installation If you’re usi

Dasmer Singh 93 Nov 12, 2022
On-device wake word detection powered by deep learning.

Porcupine Made in Vancouver, Canada by Picovoice Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening

Picovoice 2.8k Dec 30, 2022
Simulate any device and settings on one simulator or device.

SwiftUI-Simulator Enables the following settings without settings or restarting the simulator or real device. Any device screen Light/Dark mode Locale

Yusuke Hosonuma 70 Dec 19, 2022