Thank you for your interest in contributing to SDVersion! This document provides guidelines for contributing.
When Apple releases new devices, SDVersion needs to be updated. Here's how:
Device identifiers (machine IDs) can be found from these sources:
-
Update
SDiOSVersion.h:- Add a new enum value in the appropriate year section
- Use the next available integer value in that section
-
Update
SDiOSVersion.m:- Add the device identifier mapping in
deviceNamesByCode - Add the display name in
deviceNameForVersion:
- Add the device identifier mapping in
-
Update screen size detection if needed:
- If the device has a new screen resolution, update
resolutionSize
- If the device has a new screen resolution, update
-
Update
SDwatchOSVersion.h:- Add enum values for each size variant
-
Update
SDwatchOSVersion.m:- Add identifier mappings
- Update display names
- Update screen size detection if new sizes are introduced
-
Update
SDMacVersion.h:- Add new ChipType if applicable (M5, etc.)
-
Update
SDMacVersion.m:- Add model detection in
deviceInformationForModel: - Map to appropriate device version and chip type
- Add model detection in
- Follow existing Objective-C conventions in the codebase
- Use 4-space indentation
- Keep device mappings alphabetically organized by identifier
- Group devices by year in comments
Before submitting a PR:
- Ensure the project builds on all platforms (iOS, macOS, watchOS, tvOS)
- Test with the simulator for new devices if available
- Run
pod lib lintto validate the podspec
- Fork the repository
- Create a feature branch (
git checkout -b feature/add-iphone-17) - Commit your changes with clear messages
- Update the CHANGELOG.md
- Submit a pull request
Open an issue for discussion before making large changes.