Skip to content

Instantly share code, notes, and snippets.

@zats
Last active September 24, 2023 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zats/1f460a4f4709671a98ebdcb24d7f312d to your computer and use it in GitHub Desktop.
Save zats/1f460a4f4709671a98ebdcb24d7f312d to your computer and use it in GitHub Desktop.
Set voice over enabled with private API - not for AppStore
static void _setVoiceOver(BOOL enabled) {
NSString* const accessibilityUtilitiesPath = [[NSBundle bundleForClass:UIApplication.class]
.bundleURL
.URLByDeletingLastPathComponent
.URLByDeletingLastPathComponent
URLByAppendingPathComponent:@"PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities"]
.relativePath;
void* handler = dlopen([accessibilityUtilitiesPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);
if (!handler) {
return;
}
void (*_AXSVoiceOverTouchSetEnabled)(BOOL) = dlsym(handler, "_AXSVoiceOverTouchSetEnabled");
_AXSVoiceOverTouchSetEnabled(enabled);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment