I would like to ask how to design voice over assistance on demand with VoiceOver enabled.
I have such code to create UIButton:
_myLocationButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[_myLocationButton setImage:[UIImage imageNamed:@"my_location_icon"] forState:UIControlStateNormal];
_myLocationButton.accessibilityLabel = @"My location";
_myLocationButton.accessibilityHint = @"Double tap to hear where You are, in which zone or near zone and floor information in building";
[_myLocationButton addTarget:self
action:@selector(myLocationButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
Now in myLocationButtonPressed method I have such code:
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, positionDescription);
My question is. When I'm trying to double tap when myLocationButton is active the VoiceOver is saying only: "My location". What I would like is after double tapping I'd like to hear positionDescription not button accessibilityLabel. I know that method myLocationButtonPressed is invoking but from unknown reason posting UIAccessibilityAnnouncementNotification event do nothing and I can't hear anything.
Can somebody give me some advice how to approach this kind of problem.