2
 UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, _navBar);
 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"Hello world Nav Bar Showed up", @"Voice Over hint"));
 });

I am trying to announce "Nav Bar" then trying to announce the "Hello World nav bar showed up". If I do this using the above lines of code without the dispatching, the navbar becomes focused , the announcements starts and it gets cut off half way through saying "Nav Bar".

I am doing the same type of change of focus and announcement notifications in many places in the app. I'm not really happy about throwing in arbitary delays just to get it working. Do any of you have a better idea to do this ? (without using the dispatch after a particular delay) ? Any comments/ opinions will be greatly appreciated.

dashuser
  • 181
  • 1
  • 3
  • 16

0 Answers0