Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] iOS TouchEffect implementation fails to set UIGestureRecognizerState #1953

@AdamEssenmacher

Description

@AdamEssenmacher

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:

Possibly related Xamarin.Forms issues:

Stack Trace

N/A

Link to Reproduction Sample

See @mikepotvin's sample repo here

Steps to Reproduce

  1. Attach a TouchEffect to an element in project targeting iOS
  2. Place the element from (1) into a ScrollView
  3. Place a breakpoint in ShouldRecognizeSimultaneously on the TouchUITapGestureRecognizerDelegate here
  4. Run the project while debugging.
  5. Scroll the ScrollView from (2) with a swipe.
  6. Tap the element with the TouchEffect from (1).
  7. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Breaky break.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions