Contributing to SDVersion
December 28, 2025 ยท View on GitHub
Thank you for your interest in contributing to SDVersion! This document provides guidelines for contributing.
Adding New Device Support
When Apple releases new devices, SDVersion needs to be updated. Here's how:
Finding Device Identifiers
Device identifiers (machine IDs) can be found from these sources:
Adding a New iPhone/iPad
-
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
Adding a New Apple Watch
-
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
Adding a New Mac
-
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
Code Style
- 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
Testing
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
Pull Request Process
- 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
Questions?
Open an issue for discussion before making large changes.