MichaelRumpler / GestureSample

Sample App for MR.Gestures
MIT License
58 stars 17 forks source link

In iOS, TouchUp method does not invoked for child elements #14

Closed Lakshminatarajan closed 5 years ago

Lakshminatarajan commented 5 years ago

I have custom grid renderer in Mr.Gesture content page. In iOS, GridExtRenderer has the following override methods.

  public class GridExtRenderer : VisualElementRenderer<GridExt>
    {
        public GridExtRenderer()  
        {
        }

        protected override void OnElementChanged(ElementChangedEventArgs<GridExt> e)
        {
            base.OnElementChanged(e);
        }

        public override void TouchesBegan(NSSet touches, UIEvent evt)
        {
            base.TouchesBegan(touches, evt);
        }

        public override void TouchesMoved(NSSet touches, UIEvent evt)
        {
            base.TouchesMoved(touches, evt);
        }

        public override void TouchesEnded(NSSet touches, UIEvent evt)
        {
            base.TouchesEnded(touches, evt);
        }

        public override void TouchesCancelled(NSSet touches, UIEvent evt)
        {
            base.TouchesCancelled(touches, evt);
        }
    }

While doing simple drag using touch, TouchesBegan and TouchesMoved method is called. But TouchesEnded method did not gets invoked. After ToucesMoved gets called, the touch is passed to TouchUp event handler of Mr.Gestures only and not the child event. Repeat the process for second time, now it will not invoke any of the touch events again whereas TouchesEnded doesn’t invoke one time also which is needed for our implementation.

The issue reporting sample in the attachment. Sample.zip

GnanaPriyaNamasivayam commented 5 years ago

@MichaelRumpler , Any update on this..

MichaelRumpler commented 5 years ago

I could reproduce the problem, but don't know why your handlers are not called. I don't use those methods in my renderers at all. I add UIGestureRecognizers and use the TouchesBegan/-Ended/-Cancelled methods there. Maybe you can try that. Or you don't use those methods, but use the MR.Gestures events instead.