Bug 12074 - Accessibility: PerformMagicTap is missing
Summary: Accessibility: PerformMagicTap is missing
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: 6.2.5
Assignee: Bugzilla
Depends on:
Reported: 2013-05-02 10:22 UTC by GouriKumari
Modified: 2013-05-02 15:24 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Sebastien Pouliot 2013-05-02 11:17:26 UTC
They were both added in the bindings inside UIAccessibilityAction - but that type is not exposed anywhere I can see (so no code is generated for them).

According to docs [1] it should be adopted by NSObject but I'm not sure it's a good idea (maybe UIResponder ?). That might be why it was not assigned... (miguel?)

Gouri, do you have links to sample that use it (anything UIAccessibilityAction) ?

[1] http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAccessibilityAction_Protocol/Introduction/Introduction.html
Comment 3 Sebastien Pouliot 2013-05-02 11:41:45 UTC
I hate stuffing more informal protocols inside NSObject - it's almost impossible to discover :(

@interface ZBEAppDelegate : UIResponder <UIApplicationDelegate>

^ and we can't do something like this since our own UIApplicationDelegate inherits from NSObject (i.e. no overriding UIResponder - if we wanted to add it there).

OTOH you should be able to add it manually inside your AppDelegate, e.g.

	[Export ("accessibilityPerformMagicTap")]
	public bool AccessibilityPerformMagicTap ()
		// viewController.TogglePause (); // must be from the sample
		return true;
Comment 4 Sebastien Pouliot 2013-05-02 14:10:03 UTC
According to [1] UIAccessibilityAction are used on view controllers, views or for magic tap on the appdelegate. 

So UIResponder looks like a "nicer" place (compared to NSObject) for all but hte magic tap case. So maybe we need to special case the later ? 

OTOH I never used the API so it might not be a good idea to add it *right now* unless we're sure - even more if the workaround can be used in the mean time.

[1] http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Accessibility/AccessibilityfromtheViewControllersPerspective.html
Comment 5 Miguel de Icaza [MSFT] 2013-05-02 14:19:02 UTC
The history behind the adoption of the UIAccessibility protocol is this.

While Apple defines the extension methods on NSObject, these extensions only exist when an application links with UIKit.  While this means that effectively every iOS app adopts the protocol, realistically, it means that it is only useful on UIKit defined classes.

While we could add this to NSObject, I felt that intellisense would get polluted with a lot of junk for the default case, so I went with a different path: I only adopted this protocol on a handful of UIKit classes.   

I think that this case should be handled in the same way.

My tree is currently in a very complicated state, so I cant look at it, but would love if someone can add this.
Comment 6 Sebastien Pouliot 2013-05-02 15:24:30 UTC
Fixed in master a366ab52c1b69c547d504d49718dd32bb0090b03
and monotouch-6.2.5-branch c01ab3e0f17b429c9f72b31128c8145f2e6b7800