{"id":1256,"url":"https://github.com/Nirma/UIDeviceComplete","last_synced_at":"2025-08-06T13:32:19.920Z","repository":{"id":23638228,"uuid":"96057466","full_name":"Nirma/UIDeviceComplete","owner":"Nirma","description":"UIDevice extensions that fill in the missing pieces.","archived":false,"fork":false,"pushed_at":"2024-10-03T16:45:56.000Z","size":188,"stargazers_count":419,"open_issues_count":4,"forks_count":34,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-12-09T04:33:31.347Z","etag":null,"topics":["ios","swift","swift4","uidevice"],"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/Nirma.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-03T00:55:01.000Z","updated_at":"2024-12-03T07:55:40.000Z","dependencies_parsed_at":"2024-10-12T14:51:15.739Z","dependency_job_id":null,"html_url":"https://github.com/Nirma/UIDeviceComplete","commit_stats":{"total_commits":156,"total_committers":17,"mean_commits":9.176470588235293,"dds":0.4871794871794872,"last_synced_commit":"7f2d9f53bc107de028cafdc67150859a049311e5"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nirma%2FUIDeviceComplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nirma%2FUIDeviceComplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nirma%2FUIDeviceComplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nirma%2FUIDeviceComplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nirma","download_url":"https://codeload.github.com/Nirma/UIDeviceComplete/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228835868,"owners_count":17979168,"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":["ios","swift","swift4","uidevice"],"created_at":"2024-01-05T20:15:42.342Z","updated_at":"2024-12-09T14:30:49.349Z","avatar_url":"https://github.com/Nirma.png","language":"Swift","funding_links":[],"categories":["Hardware","Libs","Swift","Device [🔝](#readme)"],"sub_categories":["Other Hardware","Device","Other free courses"],"readme":"# UIDeviceComplete\nUIDevice extensions that fill in the missing pieces.\n\n[![Build Status](https://travis-ci.org/Nirma/UIDeviceComplete.svg?branch=master)](https://travis-ci.org/Nirma/UIDeviceComplete)\n![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg)\n[![CodeCov](https://img.shields.io/codecov/c/github/Nirma/UIDeviceComplete.svg)](https://codecov.io/gh/Nirma/UIDeviceComplete)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/UIDeviceComplete.svg)](#cocoapods)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)\n\n# Whats this library about?\n`UIDeviceComplete` is an iOS library intended to be a collection of extensions to `UIDevice` \nthat provides functionality that `UIDevice` currently lacks like determining which iOS device\nyou have (i.e iPhone X, iPhone 8, iPhone SE, iPad Pro, iPhone 7 etc) or determining the screen size of the device\nin inches.\n\n# Features\n- [x] Detect specific device like iPhone 7, iPhone SE or iPad Pro\n- [x] Get screen size of device in inches\n- [x] Get iOS Device family (iPod, iPhone or iPad)\n\n### Dont see a feature you need?\nFeel free to open an Issue requesting the feature you want or send over a pull request!\n\n# Use\nAll of the extensions are called off of the `dc` variable which ***stands for ([UI]DeviceComplete)*** object that this \nlibrary extends onto `UIDevice` that way native methods of `UIDevice` and methods of this library can\neasily be seen, also lowering the possibility of naming conflicts.\n\n\n### Getting common device name\n\n```swift \nUIDevice.current.dc.commonDeviceName // iPad Pro (12.9 inch, Wi-Fi+LTE)\n```\n\n### Detecting iOS Device models\n\n```Swift\nlet device = UIDevice.current.dc.deviceModel\n\nswitch device {\n    case .iPhoneX:\n        print(\"So hows that iPhone X notch thing working out? Right...\")\n    case .iPhone6Plus, .iPhone7Plus:\n        print(\"Lots of screen realestate eh?\")\n    case .iPhoneSE, .iPhone5, iPhone5S:\n        print(\"Less iPhone is more iPhone...\")\n    case .iPadPro:\n        print(\"Why?\")\n    default:\n        print(\"Not sure what this is...\")\n}\n```\n\n### Detecting iOS Device Screen Size (Inches)\n\nScreen size can be be queried with the following computed property returning a simple `Double`\nthat represents the screen size in inches:\n\n```swift\nlet screenSize: Double = UIDevice.current.dc.screenSize.sizeInches\n\nif screenSize \u003c= 4.0 {\n    print(\"Modest screen size; not so modest price tag\")\n} else if screenSize \u003e= 5.5 {\n    print(\"Plus is always a plus\")\n} else {\n    print(\"Chances are this is an iPad or an iPhone (Texas Edition).\")\n}\n```\n\n### Detecting iOS Device Family\n\nIf the type of device family is all you are after i.e iPhone or iPad and the specific model\nis not important then `DeviceFamily` might be what you need.\n\n```Swift\nlet deviceFamily = UIDevice.current.dc.deviceFamily\n\nswitch deviceFamily {\n    case .iPhone:\n        print(\"...phone home?\")\n    case .iPad:\n        print(\"when it comes to screen size; more is more\")\n    case .iPod:\n        print(\"Why not?\")\n    default:\n        print(\"No family...\")\n}\n```\n\n## Installation\n\n#### Carthage\n\nIf you use Carthage to manage your dependencies, simply add\nUIDeviceComplete to your `Cartfile`:\n\n```\ngithub \"Nirma/UIDeviceComplete\"\n```\n\nIf you use Carthage to build your dependencies, make sure you have added `UIDeviceComplete.framework` to the \"_Linked Frameworks and Libraries_\" section of your target, and have included `UIDeviceComplete.framework` in your Carthage framework copying build phase.\n\n#### CocoaPods\n\nIf you use CocoaPods to manage your dependencies, simply add\nthis line to your `Podfile`:\n\n```\nuse_frameworks!\npod 'UIDeviceComplete'\n```\n\n\n## Contributing to this project\n**Contributions are highly welcome**\n\nIf there is something you wish to fix about the project, or wish to add any other kind of enhancements,\npropose to add to the project. Please feel free to send over a pull request \nor open an issue for this project.\n\n## License\n\nUIDeviceComplete is released under the MIT license. [See LICENSE](https://github.com/Nirma/UIDeviceComplete/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNirma%2FUIDeviceComplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNirma%2FUIDeviceComplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNirma%2FUIDeviceComplete/lists"}