impl Index on XCUIElementQuery, siri, device buttons and orientation in objc2-xc-ui-automation #809
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.