Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrealufino/Deviice
Swift library to easily check the current device and some more info about it.
https://github.com/andrealufino/Deviice
device device-detection device-detector device-family ios ipad iphone model swift swift5 system uidevice
Last synced: 3 days ago
JSON representation
Swift library to easily check the current device and some more info about it.
- Host: GitHub
- URL: https://github.com/andrealufino/Deviice
- Owner: andrealufino
- License: mit
- Created: 2016-03-20T21:38:40.000Z (over 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-29T18:14:56.000Z (2 months ago)
- Last Synced: 2024-11-16T09:48:50.863Z (26 days ago)
- Topics: device, device-detection, device-detector, device-family, ios, ipad, iphone, model, swift, swift5, system, uidevice
- Language: Swift
- Homepage:
- Size: 910 KB
- Stars: 73
- Watchers: 9
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - Deviice - Simply library to detect the device on which the app is running (and some properties). (Hardware / Other Hardware)
- awesome-swift - Deviice - Swift library to easily check the current device and some more info about it. (Libs / Device)
- awesome-swift - Deviice - Swift library to easily check the current device and some more info about it. (Libs / Device)
- awesome-ios-star - Deviice - Simply library to detect the device on which the app is running (and some properties). (Hardware / Other Hardware)
- fucking-awesome-swift - Deviice - Swift library to easily check the current device and some more info about it. (Libs / Device)
- awesome-swift - Deviice - Swift library to easily check the current device and some more info about it. ` 📝 2 months ago ` (Device [🔝](#readme))
README
[![CI Status](https://img.shields.io/travis/Andrea%20Mario%20Lufino/Deviice.svg?style=flat)](https://travis-ci.org/Andrea%20Mario%20Lufino/Deviice)
[![Version](https://img.shields.io/cocoapods/v/Deviice.svg?style=flat)](http://cocoapods.org/pods/Deviice)
[![License](https://img.shields.io/cocoapods/l/Deviice.svg?style=flat)](http://cocoapods.org/pods/Deviice)
[![Platform](https://img.shields.io/cocoapods/p/Deviice.svg?style=flat)](http://cocoapods.org/pods/Deviice)![Logo](./Example/Deviice/Deviice.png)
## Version 2
The library has been completely rewritten from scratch. This version still offers the `Deviice` structure, but it has been marked as deprecated and will be removed in future versions. Now, the whole magic is done via the `Device` class.
## Usage
There is documentation for all the classes, methods and properties in the code.
To give a general idea, this is how things work.```swift
let device = Device.init() // This instantiate a `Device` object based on the current device.print(device.model.marketingName) // This prints "iPhone 12 Pro" in case it is running on an iPhone 12 Pro
```
There is also the possibility to get the actual device being simulated on a Mac.
```swift
let device = Device.init()print(device.model.marketingName) // This will print "Simulator"
print(device.actualModel.marketingName) // This will print "iPhone 12 Pro" in case you're simulating an iPhone 12 Pro
```With the first release, there's no chance to get the type of connectivity of a specific device. This will be probably added later.
## Requirements
This library works on iOS 12 or higher.## Installation
Deviice is available through Swift Package Manager and [CocoaPods](http://cocoapods.org).
### Swift Package Manager
You can add this library via Swift Package Manager, using this url `https://github.com/andrealufino/Deviice`.
### CocoaPods
To install
it, simply add the following line to your Podfile:```ruby
pod "Deviice"
```## Author
Andrea Mario Lufino, [andrealufino.com](https://andrealufino.com). Thanks to all the contributors.
## License
Deviice is available under the MIT license. See the LICENSE file for more info.