0

I use this code in AppDelegate:

- (BOOL)accessibilityPerformMagicTap {
    NSLog(@"Appdelegate = %s",__func__);
    return YES;
}

When I click the home button and two-fingered double tap while using VoiceOver activates, this method is not invoked. What is the reason for this? How can I use this method with my music app?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
0x0
  • 43
  • 6

1 Answers1

1

You cannot. The method is called on the focused accessibility element while the app is foregrounded.

Justin
  • 20,509
  • 6
  • 47
  • 58
  • Spotify had that, How they did – 0x0 Apr 15 '17 at 09:09
  • Spotify is likely responding to [remote control events](https://developer.apple.com/reference/mediaplayer/mpremotecommandcenter). Unless otherwise handled by the foregrounded app, the Magic Tap VoiceOver gesture toggles audio playback system-wide. – Justin Apr 15 '17 at 21:50
  • thanks, I have another question, when I override accessibilityPerformMagicTap in tableviewController, How can I know which cell the voiceover focused in accessibilityPerformMagicTap method when two-fingered double tap – 0x0 Apr 17 '17 at 08:37
  • Please post a new question on StackOverflow if you need help with a different issue. – Justin Apr 19 '17 at 00:12