Bug 14937 - ShouldRecognizeSimultaneously property does not work as usual on iOS 7
Summary: ShouldRecognizeSimultaneously property does not work as usual on iOS 7
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.0.0.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-09-23 15:27 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2014-01-13 05:10 UTC (History)
6 users (show)

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


Attachments
Test case (6.92 KB, application/zip)
2013-09-23 15:27 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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:
Status:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-09-23 15:27:49 UTC
Created attachment 4963 [details]
Test case

Reported for forum thread:
http://forums.xamarin.com/discussion/8111/ios-7-major-trouble-with-anonymous-methods


## Steps to reproduce
1. Open attached test case.
2. Run on iOS 7 (simulator or device).
3. Simultaneously pinch and pan. For example on the simulator hold Option, then click and hold the left mouse button, then drag the mouse a short distance, then press and hold Shift, and then continue to drag the mouse back and forth.


## Result
The console only shows "Gesture: pinch".
When running on iOS 6, the console shows both "Gesture: pinch" and "Gesture: pan".


## Regression status
When built with Xamarin.iOS 6.4.5.0, the sample shows both "Gesture: pinch" and "Gesture: pan" in the console, even when running on iOS 7.


## Work-around
If you use the `Delegate` property instead of `ShouldRecognizeSimultaneously`, the console again shows both messages. For example, in the test case, comment out lines 46-55 in BlankViewController.cs, and uncomment lines 57-58.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-09-24 17:12:50 UTC
I can't reproduce this, but I'm not entirely sure I did the right thing.

Just to make sure: on Xamarin.iOS 7.0 you're not able to get the simultaneous "Gesture: pinch" and "Gesture: pan" no matter what you do?

Here's a video of what I did and the results: http://screencast.com/t/UsbIB5Vji
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2013-09-25 12:01:48 UTC
Huh, interesting! I didn't have an option for a non-retina iOS simulator on my installation. The example works correctly with Xamarin.iOS 7.0 + iOS 6 simulator. Maybe that's the combination you're seeing?

After installing the iOS 6 simulator, I can reproduce your result. I think the problem is that Xamarin Studio claims it's running the iOS 7 simulator, but it looks like there's another bug where Xamarin Studio isn't able to switch the simulator to a different configuration, so it's still stuck on the iOS 6 simulator:
http://www.screencast.com/t/lqCiQ4Gn9TT9

I can reproduce the problem again if I first switch the "Hardware" setting to one of the "iPhone Retina -> iOS 7.0" options, and then launch the app from Xamarin Studio.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-09-26 08:20:38 UTC
Fixed.

monotouch/master: 28cc2dd81045d5905177bec774d8aac29058a5a9
Comment 4 Dan Abramov 2013-09-26 10:52:22 UTC
This is a major issue for us.

Will downgrading to Xamarin.iOS 6.x solve the problem?
(We're not using any of iOS 7 features.)
Comment 5 Rolf Bjarne Kvinge [MSFT] 2013-09-26 17:12:28 UTC
Dan,

It's easy to work around this, just add event handlers for ShouldRequireFailureOf and ShouldBeRequiredToFailBy that return false:

PinchRecognizer.ShouldRequireFailureOf = (a, b) => { return false; };
PinchRecognizer.ShouldBeRequiredToFailBy = (a, b) => { return false; };
Comment 6 Dan Abramov 2013-09-26 18:00:30 UTC
Thanks a lot!
For now, I worked around the bug by [explicitly passing the delegate](http://forums.xamarin.com/discussion/comment/28052/#Comment_28052).

I wonder though—are you certain this issue is specific to gesture recognizers and doesn't affect other delegate-based classes whatsoever?
Comment 7 Adam Kemp 2013-10-03 19:56:49 UTC
FYI, in case it wasn't clear, this bug affects apps running on iOS 7 even if they link against a pre-iOS 7 SDK. It turns out iOS 7 will call those delegate methods if they exist regardless of which SDK you link against.
Comment 8 narayanp 2014-01-13 05:10:41 UTC
I have checked this issue with following builds:

All Mac
X.S 4.2.3(build 35)
Mono 3.2.6
X.iOS 7.0.4.166

I am seeing both Gesture Pinch and Gesture Pan for iOS 7.0 Device and  Simulator. this is the screencast for the same: http://screencast.com/t/gqKV2K5NfQxw

Closing this issue.