stephan-tolksdorf / STULabel

A faster and more flexible label view for iOS
Other
120 stars 28 forks source link

Voice-over accessibility crashes over labels with STUImageTextAttachment #12

Closed Fabezi closed 1 year ago

Fabezi commented 4 years ago

Attached example project:

Screenshot 2020-04-18 at 9 22 00

accessibility-crash.zip

Fabezi commented 4 years ago

Basically, if you do not provide stringRepresentation for STUImageTextAttachment(stringRepresentation: nil), STUTextFrameAccessibilityElement.mm:304 string range will be null and throws out of bounds

NSString* const language = [label attribute:UIAccessibilitySpeechAttributeLanguage atIndex:0 longestEffectiveRange:&effectiveRange inRange:NSRange{0, stringRange.length}];
-> Thread 1: Exception: "NSRLEArray objectAtIndex:effectiveRange:: Out of bounds"
stephan-tolksdorf commented 1 year ago

Thanks for the report and repro sample! Should be fixed now.