Post

Replies

Boosts

Views

Activity

NSAttributedString.Key.accessibilitySpeechIPANotation in substrings
Hi, I am trying to improve the pronunciation of a couple of words within a large block of text for VoiceOver users by applying the .accessibilitySpeechIPANotation key to a range in an NSAttributedString. However it appears that the notations are ignored when the range is in the middle of the text. It only seems to apply if the attributed range is at the end of a sentence. For example, using this code sample: let s: String = "live radio" let ipa = "ˈla͡ɪv" let attributedString = NSMutableAttributedString(string: s) let range = attributedString.string.range(of: "live") attributedString.addAttributes(     [.accessibilitySpeechIPANotation: ipa],     range: NSRange(range!, in: attributedString.string)) label.attributedText = attributedString the label will be read incorrectly ("live" rhyming with "give"). However if s = "listen on radio live" or "listen on radio live. today!" then it's read correctly. Then if I change it to `"listen on radio live today!", it's wrong again. What am I missing? Is there some sort of "end of word" symbol I need to include in my IPA notation? (This is on iOS 15. It seems to work like I expect on iOS 12 FWIW).
2
0
495
Sep ’21
Inline UIDatePicker accessibility labels ignore configured timezone
I have a date picker using the new inline style configured to use a specific timezone like so: let aucklandDatePicker = UIDatePicker() aucklandDatePicker.datePickerMode = .date aucklandDatePicker.preferredDatePickerStyle = .inline aucklandDatePicker.timeZone = TimeZone(identifier: "Pacific/Auckland")! When run on a device in a vastly different timezone (e.g. Anchorage, USA), the accessibility labels for the dates in the date picker do not match what is displayed. For example the date displayed as Friday, January 15, 2021 (today in Auckland) has the accessibility label "Today, Thursday, January 14" (which would be correct in Anchorage). Is there something I am missing?
0
0
627
Jan ’21
UIBarButtonItemAppearance "leaks" button background between view controllers
I have a navigation controller with a root view controller and two sibling child view controllers. The root view controller hides the navigation bar using setNavigationBarHidden. The first view controller shows the navigation bar and has background images applied to the navigation bar buttons using the iOS 13 UIBarButtonItemAppearance API on its navigationItem. The second view controller uses the standard appearance with no customisation. Launching the app and navigating to the second second view controller works as expected. However going to the first child, then back, then into the second view controller causes the button background image to appear behind the back button. Other bar buttons don't seem to be affected. Is there a property in UINavigationBarAppearance or similar that I'm supposed to use instead of setNavigationBarHidden? If not, I can work around it by setting the background image to a clear image in viewWillDisappear, however it seems like a bug. Here's an example project to demonstrate: https://www.icloud.com/iclouddrive/0fq0GIpyN6IDY0G79oh1wzrqA#NavigationItemAppearance
0
0
300
Nov ’20