impl Index on XCUIElementQuery, siri, device buttons and orientation in objc2-xc-ui-automation#809
Merged
madsmtm merged 5 commits intomadsmtm:mainfrom Jan 21, 2026
Conversation
Collaborator
Author
|
I tested record-compressed.mp4The change in orientation doesn't change the macOS simulator app's orientation but it does actually change the orientation of the app inside the simulator. |
madsmtm
reviewed
Jan 21, 2026
Comment on lines
7
to
15
| # Maybe, unsure if desirable: | ||
| default = [ | ||
| "std", | ||
| "block2", | ||
| "objc2-app-kit", | ||
| "objc2-core-foundation", | ||
| "objc2-core-location", | ||
| "objc2-ui-kit", | ||
| ] |
Owner
There was a problem hiding this comment.
I don't think this works without changes to the translator, so I've removed it for now
madsmtm
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been playing around with the
objc2-xc-ui-automationcrate and figure some additional features should be added.Most of this is really just a stop gap in place of #408
I spent like 20 minutes fighting
Retained<XCUIElementQuery>and&XCUIElementQueryand then I asked claude for some help which it suggested dereferencing*mut T. I'm not really a fan but I'm not sure what's better.I was already in the space and had noticed some other pieces that would be nice.
framework-crates/objc2-xu-ui-automation/src/device_buttons.rshas theXCUIDeviceButtonsconditionally compiled for iOS, watchOS, visionOS and tvOS. These can be used viapressButton.framework-crates/objc2-xu-ui-automation/src/siri.rsadds getting thesiriServiceout of theXCUIDevice, and the correspondingXCUISiriServicestruct and it's few calls.framework-crates/objc2-xu-ui-automation/src/orientation.rsadds the calls ofsetOrientationandorientationonXCUIDevice. This should ideally be behind a feature flag ofobjc2-ui-kitas the generated stuff would be and then haveobjc2-ui-kitas an optional dependency. It's sloppy but I figure that just duplicating the UIOrientation struct might be the least bad. Is there a flag totranslation-config.tomlto do this nicely?If there's not a great way to do the
Indextrait ororientation, I'm cool with dropping them.