AnbalaganD/iModels
This library provide device(iPhone) model name with human readable way
Examples
To run the Example project, clone the repo, and run pod install from the Example directory first, then open the Xcode workspace.
To run the iModelsExample project, clone the repo, and open the Xcode project.
Installation
Swift Package manager (SPM)
iModels is available through SPM. Use below URL to add it as a dependency
dependencies: [
.package(url: "https://github.com/AnbalaganD/iModels", .upToNextMajor(from: "0.1.8"))
]CocoaPods
iModels is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'iModels'Note: CocoaPods updates will not be provided for upcoming releases, as CocoaPods is no longer actively supported and has entered maintenance mode.
Usage
import iModels
Device.modelName // The most commonly used
Device.identifier // Apple's identifiers
// for other device identifiers
print("\(Device.modelName(for: "iPhone8,2") ?? "unknown")")
// output: iPhone 6s PlusSimulator Note
The Device.modelName variable will now append the name "Simulator" to the model name when running within the simulator. If you want to avoid this behavior, you can use Device.modelName(for: Device.identifier).
License
iModels is available under the MIT license. See the LICENSE file for more info.
Package Metadata
Repository: AnbalaganD/iModels
Stars: 9
Forks: 1
Open issues: 0
Default branch: main
Primary language: swift
License: MIT
Topics: cocoapods, device-model, devicename, ios, ipad, iphone, modelname, spm, swift, swiftpackagemanager, swiftui, watchos
README: README.md