Post

Replies

Boosts

Views

Activity

Reply to UIViewController in UIStackView
The issue may be caused by the fact that the VC (B) inside it will not have set its size until after the VC (B) has set its layout after viewDidAppear was called. You may want to check what the height of the VC (B) is inside VC (A)'s viewDidAppear, and if that is still 0, you may need to setup a delegate from the VC (B) viewDidAppear to send the height after auto layout has finished up. If you are able to get the height that way, you could then manually setup the height of the stack view. An easier solution would be to not use a VC inside a stack view, and instead use a UIView, if that is possible for your design at all.
Jun ’20
Reply to UITextField undo crash
I think this crash may be caused by a bug. If you have "abcdef" and then undo "abcdef" it tries to replace the range with empty strings. It should be doing this on range (5, 0), however, it is trying to do it from (10, 5), which doesn't exist, thus the out of index crash. As a work around, you could change your code to look like: func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {         guard let text = textField.text else { return true }         let str = text + string         if str.count <= 30 {             if (string.isEmpty &amp;&amp; range.length > 0) {                 textField.text = text.count > range.length ? String(text.dropLast(range.length)) : ""                 return false             }             return true         }         return false     } This will still allow the undo function to work, while preventing any crashes. Hope this helps!
Jul ’20
Reply to In cross-screen navigation, VoiceOver's focus is starting on content on iOS13, not the nav bar
There seem to be a lot of VoiceOver changes since iOS 13, and even more in iOS 14. I am not certain why Apple is making some of the decisions they are making, as they seem to make VoiceOver support harder and harder to manage properly. In your case, I would recommend posting a UIAccessibility notification like the one below, where backButton is replaced with a reference to the back button (or whatever element you want VoiceOver to focus on): UIAccessibility.post(notification: .layoutChanged, argument: backButton)
Oct ’20
Reply to Add Narration Instead of VoiceOver
I was able to figure this out on my own. Adding the following code to my class that extends UILabel did the trick: override var accessibilityContainerType: UIAccessibilityContainerType {         get { return .semanticGroup }         set { }     }          override var accessibilityLabel: String? {         get { return "" }         set { }     }          override var accessibilityHint: String? {         get { return "" }         set { }     }
Dec ’20