How to get UIAccessibilityNotifications in iPhone app

I am interested in making changes to the user interface in my application programmatically and thought the protocol UIAccessibilitymight help. I found how to send messages UIAccessibilityLayoutChangedNotificationand UIAccessibilityScreenChangedNotification, but I'm not sure how to register to receive these notifications.

I tried to use NSNotificationCenter, but the parameter is nameexpecting string, while the two above notifications have a type UIAccesibilityNotificationsthat is int.

Any idea how to register for these notifications?

Thanks!

+5
source share
1 answer

! , "", . (.. ", " )


UIKit, , UIAccessibilityPostNotification :

static void (*__UIAccessibilityBroadcastCallback)(UIAccessibilityNotifications notification, id argument);
void UIAccessibilityPostNotification(UIAccessibilityNotifications notification, id argument) {
    __UIAccessibilityBroadcastCallback (notification, argument);
}

, "" "" . , . .

, API _UIAccessibilitySetBroadcastCallback:

void _UIAccessibilitySetBroadcastCallback(void (*replacement)(UIAccessibilityNotifications notification, id argument)) {
   __UIAccessibilityBroadcastCallback = replacement;
}

"get" ( ), .

+5

All Articles