{"id":20852612,"url":"https://github.com/eleev/device-kit","last_synced_at":"2025-10-18T10:14:59.945Z","repository":{"id":56931902,"uuid":"157854957","full_name":"eleev/device-kit","owner":"eleev","description":"📱Get extended information about an iOS/iPadOS device.","archived":false,"fork":false,"pushed_at":"2020-01-04T09:12:30.000Z","size":139,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T11:55:32.855Z","etag":null,"topics":["apple","device-info","framework","ios","ram","screen-info","spm","swift","swift-package-manager","uidevice","uikit","uiscreen"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eleev.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":"2018-11-16T10:56:46.000Z","updated_at":"2025-02-23T08:47:57.000Z","dependencies_parsed_at":"2022-08-21T05:50:33.955Z","dependency_job_id":null,"html_url":"https://github.com/eleev/device-kit","commit_stats":null,"previous_names":["jvirus/device-kit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleev%2Fdevice-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleev%2Fdevice-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleev%2Fdevice-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eleev%2Fdevice-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eleev","download_url":"https://codeload.github.com/eleev/device-kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253681886,"owners_count":21946823,"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","device-info","framework","ios","ram","screen-info","spm","swift","swift-package-manager","uidevice","uikit","uiscreen"],"created_at":"2024-11-18T03:18:12.768Z","updated_at":"2025-10-18T10:14:54.907Z","avatar_url":"https://github.com/eleev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# device-kit [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)\n\n[![Build](https://github.com/jvirus/device-kit/workflows/Build/badge.svg)]()\n[![Platforms](https://img.shields.io/badge/Platform-iOS-yellowgreen.svg)]()\n[![Language](https://img.shields.io/badge/Language-Swift_5.1-orange.svg)]()\n[![Codecov](https://codecov.io/gh/jVirus/device-kit/branch/master/graph/badge.svg)](https://codecov.io/gh/jVirus/device-kit)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)]()\n\n**Last Update: 04/January/2020.**\n\n![](logo-device_kit.png)\n\n### If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo.\n\n# ✍️ About\n📱 Framework that allows to get extended information about an `iOS` device.\n\n# 📚 Features\n- **Device Type information** \n  - Easily get a device's `identifier`\n  - Determine if an app running on a `simulator` or on an actual device\n  - Includes information about an each `iOS` device\n- **Device Storage status such as:**\n  - `Total` space\n  - `Free` space \n  - `Used` space\n  - You can format the data using various `units` (by using `ByteCountFormatter.Units`)\n- **Device Orientation information**\n  - Check whether the device is in `.portrait` or `.landscape` orientation without the need to make boilerplate `UIDevice.current.orientation` calls \u0026 `if/else` checks\n  - You can use `isPortrait` property if you'd like\n- **Device's Internet Connection status**\n  - Super easily check whether your device is connected to the internet\n  - You can get the reachability status as well\n\n# ✈️ Usage\n\nGetting device's identifier:\n\n```swift\nlet identifiers = UIDevice.current.deviceType\n// `identifiers` will hold the corresponding devices' identifiers depending on your `iOS` model\n```\n\nDeterming how much storage has left:\n\n```swift\nUIDevice.current.storageStatus.getFreeSpace(.useMB)\n// Will print something like this:\n// 139,197.3 MB\n\nUIDevice.current.storageStatus.getFreeSpace(.useGB)\n// Or you can change the unit type to Gigabytes:\n// 139.16 GB\n\nUIDevice.current.storageStatus.getFreeSpace(.useGB, includeUnitPostfix: false)\n// If you don't want to get GB, MB postfixes then specify an optional parameter for `includeUnitPostfix`:\n// 139.16\n```\n\nChecking the device's orientation:\n\n```swift\nlet orienation = UIDevice.current.deviceOrientation\n\nswitch orientation {\n  case .portrait:\n    showDrawerView()\n  case .landscape:\n    hideDrawerView()\n}\n```\n\nGetting the internet connection status:\n\n```swift\nlet internet = UIDevice.current.internetConnection\n\nguard internet.connection == .open else { \n  throw NetworkError.isNotAvailabe(\"Missing internet connection\")\n}\n\nsendRequest()\n```\n\n# 🏗 Installation\n\n## Swift Package Manager\n\n### Xcode 11+\n\n1. Open `MenuBar` → `File` → `Swift Packages` → `Add Package Dependency...`\n2. Paste the package repository url `https://github.com/jVirus/device-kit` and hit `Next`.\n3. Select the installment rules.\n\nAfter specifying which version do you want to install, the package will be downloaded and attached to your project. \n\n### Package.swift\nIf you already have a `Package.swift` or you are building your own package simply add a new dependency:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/jVirus/device-kit\", from: \"1.0.0\")\n]\n```\n\n## Manual \nYou can always use copy-paste the sources method 😄. Or you can compile the framework and include it with your project.\n\n\n# 📝 ToDo\n- [x] Lightweight `Network` reachability (with `NotificationCenter` support or more safer approach in observing changes)\n  - [ ] `NotificationCenter` observer support\n- [x] Device `orientation` \n  - [ ] `NotificationCenter` observer support\n- [ ] Interface `orientation`\n  - [ ] `NotificationCenter` observer support\n\n# 🙋‍♀️🙋‍♂️Contributing \n- There is just one main rule for contributors - **please include your extensions in separete files**. It's important since such extension can be more easily referenced and reused.\n- The other `soft` rule is - please include `unit tests` with your extensions. \n\n# 👨‍💻 Author \n[Astemir Eleev](https://github.com/jVirus)\n\n# 🔖 Licence\nThe project is available under [MIT licence](https://github.com/jVirus/device-kit/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feleev%2Fdevice-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feleev%2Fdevice-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feleev%2Fdevice-kit/lists"}