Browse Source

add comment why we are waiting 100 ms before posting the UIAccessibility notification

cyberta 3 năm trước cách đây
mục cha
commit
a42172ce42

+ 2 - 0
deltachat-ios/Chat/ChatViewController.swift

@@ -1837,6 +1837,8 @@ extension ChatViewController: MediaPickerDelegate {
 
 
     func onVoiceMessageRecorderClosed() {
     func onVoiceMessageRecorderClosed() {
         if UIAccessibility.isVoiceOverRunning {
         if UIAccessibility.isVoiceOverRunning {
+            // we need to wait a little bit, otherwise the  UIAccessibility notification is ignored and
+            // the first accessibility element on the screen gets selected
             DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
             DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
                 //return to attach button
                 //return to attach button
                 UIAccessibility.post(notification: .screenChanged, argument: self?.messageInputBar.leftStackView.subviews.first)
                 UIAccessibility.post(notification: .screenChanged, argument: self?.messageInputBar.leftStackView.subviews.first)