-
Notifications
You must be signed in to change notification settings - Fork 456
[Bug] iOS TouchEffect implementation fails to set UIGestureRecognizerState #1953
Description
Description
The TouchUITapGestureRecognizer
class defined here does not properly maintain its state machine, which results in UIKit considering the gesture recognizer permanently active. This is likely the root cause of a half-dozen or so reported bugs across Xamarin.Forms and XCT.
The TouchUITapGestureRecognizer
inherits UIGestureRecognizer
, which makes it a UIKit 'custom' gesture recognizer as documented here. Important excerpt from these docs:
Use incoming events to update the state property of your gesture recognizer. UIKit uses the gesture recognizer states to coordinate interactions with other objects in your interface.
I will open a PR to fix shortly.
Possibly related XCT issues:
- [Bug] [iOS] TouchEffect conflicts with InteractivePopGestureRecognizer and kills page gestures #1810
- [Bug] Toucheffect raised when scrolling #1261
- [Bug] iOS Touch Effects cause weird behavior with multiple selection enabled in CollectionView items #1157
- [Bug] Shell flyout menu not selected item with ripple effect #707
Possibly related Xamarin.Forms issues:
- [Bug] iOS 13.5 - page content sometimes stops scrolling Xamarin.Forms#10824
- [Bug] Overwrite method touch on iOS native overlap by Touch Effect Xamarin.Forms#14315
Stack Trace
N/A
Link to Reproduction Sample
See @mikepotvin's sample repo here
Steps to Reproduce
- Attach a TouchEffect to an element in project targeting iOS
- Place the element from (1) into a ScrollView
- Place a breakpoint in
ShouldRecognizeSimultaneously
on theTouchUITapGestureRecognizerDelegate
here - Run the project while debugging.
- Scroll the ScrollView from (2) with a swipe.
- Tap the element with the TouchEffect from (1).
- Scroll the ScrollView from (2) with a swipe.
Expected Behavior
Breakpoint from step (3) should only be hit during step (6).
Actual Behavior
Breakpoint from step (3) is hit during step (7), but not step (5). This shows UIKit believes the GestureRecognizer is still active (because it is).
Basic Information
- Version with issue: 1.0.0+
- Last known good version: None
- IDE: N/A
- Platform Target Frameworks:
- iOS: N/A, but this issue became much more problematic with back-gestures introduced in iOS 13
- Nuget Packages: N/A
- Affected Devices: N/A
Workaround
I can't think of any.
Reproduction imagery
N/A