Skip to content

bes/ios-hw-to-os-spm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ios-hw-to-os-spm

This is the Swift Package Manager package for ios-hw-to-os.

Please see the main project for more information.

Contribtions

Please contribute to ios-hw-to-os to update the JSON mappings, and to this repository to improve the Swift API.

How to use

Add https://github.com/bes/ios-hw-to-os-spm to either your own Swift package, or in XCode under "Package Dependencies".

Once you have added the package as a dependency, you can use it like so:

import IosHwToOs

func useAllMappings() {
    guard let mappings = IosHwToOsMappings.all() else {
        return
    }
    guard let device = mappings.devices.first(where: { $0.hardware == "iPhone10,1"}) else {
        return
    }
    // Prints IosHwToOsDevice(hardware: "iPhone10,1", version: "16.7.7")
    print("\(device)")
}

func useOneDevice() {
    guard let device = IosHwToOsDevice.get(hardware: "iPhone10,1") else {
        return
    }
    // Prints IosHwToOsDevice(hardware: "iPhone10,1", version: "16.7.7")
    print("\(device)")
}

About

Swift Package Manager package for ios-hw-to-os

Resources

License

Stars

Watchers

Forks

Languages