{"id":19964552,"url":"https://github.com/bojan/thingy","last_synced_at":"2025-05-03T23:30:31.471Z","repository":{"id":56924173,"uuid":"74360617","full_name":"bojan/Thingy","owner":"bojan","description":"A modern device detection and querying library.","archived":false,"fork":false,"pushed_at":"2020-07-20T11:29:03.000Z","size":676,"stargazers_count":60,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T09:53:35.526Z","etag":null,"topics":["apple","applewatch","carthage","cocoa","cocoa-framework","cocoa-touch","device","device-detection","framework","ios","ipad","iphone","ipod","mobile","spm","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"https://bojan.github.io/Thingy/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bojan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-21T12:18:27.000Z","updated_at":"2024-10-29T14:54:06.000Z","dependencies_parsed_at":"2022-08-20T22:20:15.585Z","dependency_job_id":null,"html_url":"https://github.com/bojan/Thingy","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojan%2FThingy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojan%2FThingy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojan%2FThingy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bojan%2FThingy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bojan","download_url":"https://codeload.github.com/bojan/Thingy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252269026,"owners_count":21721239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","applewatch","carthage","cocoa","cocoa-framework","cocoa-touch","device","device-detection","framework","ios","ipad","iphone","ipod","mobile","spm","swift","tvos","watchos"],"created_at":"2024-11-13T02:24:13.512Z","updated_at":"2025-05-03T23:30:30.970Z","avatar_url":"https://github.com/bojan.png","language":"Swift","readme":"# Thingy\nA modern device detection and querying library.\n\n[![Build Status](https://app.bitrise.io/app/5638e96850380bcf/status.svg?token=ATvHHXw6RMbyde-i0FPV_w\u0026branch=master)](https://app.bitrise.io/app/5638e96850380bcf)\n[![GitHub license](https://img.shields.io/badge/license-WTFPL-green)](https://raw.githubusercontent.com/bojan/Thingy/master/LICENSE)\n[![SPM](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![codecov](https://codecov.io/gh/bojan/Thingy/branch/master/graph/badge.svg)](https://codecov.io/gh/bojan/Thingy)\n\n## Features\n\n- [x] Swift 5 support\n- [x] Modern syntax\n- [x] Documentation\n- [x] Device detection\n- [x] Device family detection\n- [x] Device screens\n- [x] Simulator detection\n- [x] Simple querying\n\n## Requirements\n\n## Installation\n\n### Swift Packager Manager (SPM)\n\nUse Xcode 11 to add Thingy as a package or update your `Package.swift` for manual setups:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"HelloWorld\",\n    dependencies: [\n        .Package(url: \"https://github.com/bojan/Thingy.git\", \"3.0.0\")\n    ]\n)\n```\n\n### Carthage\n\nAdd this to your `Cartfile`:\n\n```ogdl\ngithub \"bojan/Thingy\"\n```\n\n### Manually\n\nAdd the repository as a submodule to your project.\n\n```bash\ngit submodule add https://github.com/bojan/Thingy.git Vendor/Thingy\n```\n\nOpen the newly created folder in Finder and drag `Thingy.xcodeproj` to your project.\n\nIn your project's settings, select your target and under **General** \u003e **Embedded Binaries**, add the framework depending on the target OS (iOS, watchOS or tvOS).\n\n## Usage\n\nImport the module where needed:\n\n```swift\nimport Thingy\n```\n\n### Device properties\n\nInspect the current device:\n\n```swift\n\nlet myDevice = Device()\n\n// Compare models or product families\nif myDevice.family == .tv {\n    print(\"This is an Apple TV device.\")\n}\n\nif myDevice.model != .iPhoneXSMax {\n    print(\"This is NOT an iPhone XS Max.\")\n}\n\n// Pretty printed device properties\n\nprint(myDevice.family.marketingName) // e.g. iPad\nprint(myDevice.model.marketingName) // e.g. iPhone 7 Plus\nprint(myDevice.productLine.marketingName) // e.g. Air\n\n```\n\n### Model comparison\n\n```swift\nlet myDevice = Device()\n\ndo {\n    let result = try myDevice.isEqual(to: Thingy.iPadPro12Inch)\n}\ncatch {\n    print(\"The devices are incompatible.\")\n}\n\ndo {\n    let result = try myDevice.isOlder(than: Thingy.iPadPro10Inch)\n}\ncatch {\n    print(\"The devices are incompatible.\")\n}\n```\n\n### Device size\n\n```swift\nlet myDevice = Device()\n\nif myDevice.display == .screen10_5Inch {\n    print(\"This is the 10.5in iPad Pro.\")\n}\n\n```\n\n## Contributions\n\nAll contributions and suggestions are welcome and very much appreciated.\n\nShould you have a feature request or a problem that you may experience, feel free to [open an issue](https://github.com/bojan/Thingy/issues/new).\n\nIf you are willing to contribute by adding a feature or squashing a bug or two, please submit a pull request.\n\n## Author\n\nBojan Dimovski\n- [LinkedIn](http://linkedin.com/in/bdimovski)\n\n## License\n\nThingy is available under the WTFPL license. Check the [LICENSE](https://raw.githubusercontent.com/bojan/Thingy/master/LICENSE) file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojan%2Fthingy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbojan%2Fthingy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojan%2Fthingy/lists"}