Add support for attributed label, value, hint in legend#288
Open
meherkasam-square wants to merge 4 commits into
Open
Add support for attributed label, value, hint in legend#288meherkasam-square wants to merge 4 commits into
meherkasam-square wants to merge 4 commits into
Conversation
6f954f7 to
752423e
Compare
| let activationPoint = element.object.accessibilityActivationPoint | ||
|
|
||
| // Get heading level via Key-Value Coding (set by SwiftUI's .accessibilityHeading() modifier) | ||
| let headingLevel = element.object.value(forKey: "accessibilityHeadingLevel") as? Int |
Collaborator
There was a problem hiding this comment.
is this distinct from UIAccessibilityTextAttributeHeadingLevel attribute?
Collaborator
Author
There was a problem hiding this comment.
Yeah, I discovered yesterday that they are different. This path handles the more straightforward approach in which one might add a heading level in SwiftUI.
| // Sort attributes by key name to ensure consistent ordering across test runs | ||
| let sortedAttributes = attributes.sorted { $0.key.rawValue < $1.key.rawValue } | ||
|
|
||
| for (key, value) in sortedAttributes { |
Collaborator
There was a problem hiding this comment.
Could this list of if statements be a loop of some sort?
soroushsq
reviewed
Jan 20, 2026
| static let iconToDescriptionSpacing: CGFloat = 4 | ||
|
|
||
| static let headerFont: UIFont = .italicSystemFont(ofSize: 11) | ||
| static let font: UIFont = .monospacedSystemFont(ofSize: 10, weight: .regular) |
Collaborator
There was a problem hiding this comment.
My only concern with this PR is making this monospace. Nothing else is monospace in the legend, right? Why change it from the default font?
752423e to
fca1138
Compare
fca1138 to
7496cab
Compare
soroushsq
approved these changes
Jan 20, 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.
This PR adds support for the use of attributed strings in accessibility properties such as:
.accessibilityAttributedLabel.accessibilityAttributedValue.accessibilityAttributedHintThe following keys are now supported:
.accessibilitySpeechLanguage.accessibilitySpeechSpellOut.accessibilitySpeechIPANotation.accessibilitySpeechPunctuation.accessibilitySpeechPitch.accessibilityTextHeadingLevelUIKit Demo
SwiftUI
Additionally, heading levels in SwiftUI that are configured via
.accessibilityHeadingnow directly appear next to the label.