Swiftpack.co - mock-foundation/macmodels as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by mock-foundation.
mock-foundation/macmodels 2022.07.30
A list of Mac devices with easy-to-use API. Updates itself each 10 days with GitHub Actions
⭐️ 2
🕓 1 week ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/mock-foundation/macmodels.git", from: "2022.07.30")


A list of Mac devices with easy-to-use API.

This project is using MacModelDump's code for the internal Apple Support website scraper, to power the fetching of devices from the web.


You are really adviced to use the branch: "master" way of resolving the version, because each time you refetch your dependencies, this package might get updated, and with that update an updated local list of models will be there, which allows for you to not constantly check for the version and update it yourselves.


The API is pretty simple, you can fetch all devices from the web by using MacModels.getAllDevicesOnline(), and getting a specific model by using MacModels.getDeviceOnline(by:). You can also do this locally by using MacModels.getAllDevicesLocally() and MacModels.getDeviceLocally(by:) respectively. There is also a preffered method of retrieving a specific device, which is MacModels.getDevice(by:), because it is utilizing the online list only when the device is not found locally, which results in less internet usage.

Note that the web APIs are async, so you can use them only in an async environment.


Stars: 2
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.


Release Notes

2 weeks ago

Update made on 2022.07.30

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics