-
Notifications
You must be signed in to change notification settings - Fork 457
Fix Apple Pencil compatibility for M4 iPad Pro and M2/M3 iPad Air models #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Zandor300 <[email protected]>
Co-authored-by: Zandor300 <[email protected]>
SwiftLint found issuesWarnings
Generated by 🚫 Danger |
|
@copilot remove sourceLocation lines from generated Swift file. |
Co-authored-by: Zandor300 <[email protected]>
| XCTAssertTrue(Device.iPad10.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPad10.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertFalse(Device.iPad10.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:722 |
| XCTAssertTrue(Device.iPadA16.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadA16.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertFalse(Device.iPadA16.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:728 |
| XCTAssertTrue(Device.iPadAir11M2.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadAir11M2.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertTrue(Device.iPadAir11M2.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:734 |
| XCTAssertTrue(Device.iPadAir13M2.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadAir13M2.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertTrue(Device.iPadAir13M2.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:740 |
| XCTAssertTrue(Device.iPadAir11M3.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadAir11M3.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertTrue(Device.iPadAir11M3.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:746 |
| XCTAssertTrue(Device.iPadAir13M3.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadAir13M3.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertTrue(Device.iPadAir13M3.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:752 |
| XCTAssertTrue(Device.iPadPro11M4.applePencilSupport.contains(.firstGenerationUsbC)) | ||
| XCTAssertFalse(Device.iPadPro11M4.applePencilSupport.contains(.secondGeneration)) | ||
| XCTAssertTrue(Device.iPadPro11M4.applePencilSupport.contains(.pro)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines should not have trailing whitespace.trailing_whitespace Tests.swift:758 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes incorrect Apple Pencil compatibility information for recent iPad models by updating the applePencilSupport property to match Apple's official documentation. The changes correct compatibility for M4 iPad Pro, M2/M3 iPad Air, and 10th generation iPad models.
Key changes:
- Added template support for the value 13 combination (1st gen + USB-C Pencil) in the code generation template
- Updated 8 iPad models with corrected Apple Pencil support values
- Added comprehensive test coverage for all affected devices
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Source/Device.swift.gyb | Updated applePencilSupport values for 8 iPad models (iPad 10th gen, iPad A16, 4 iPad Air models, 2 iPad Pro M4 models) and added template case for value 13 |
| Source/Device.generated.swift | Regenerated Swift code from template with corrected Apple Pencil support arrays for all affected devices |
| Tests/Tests.swift | Added testApplePencilSupport() function with 50 lines of assertions validating correct Pencil support for all 8 affected iPad models |
Fix incorrect Apple Pencil compatibility for recent iPad models
Based on Apple's official documentation at https://support.apple.com/en-au/HT211029:
Changes Summary:
✅ iPad (10th gen) & iPad (A16)
✅ iPad Air 11" & 13" (M2)
✅ iPad Air 11" & 13" (M3)
✅ iPad Pro 11" & 13" (M4)
Technical Changes:
Files Changed:
Source/Device.swift.gyb- Updated device definitions and added template case for value 13Source/Device.generated.swift- Regenerated from template without sourceLocation lines (1235 debug lines removed)Tests/Tests.swift- Added 50 lines of tests validating all changesNote: This project requires macOS with Xcode to build and test. The CI pipeline will validate these changes on macOS.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.