Forum Xamarin.iOS

Swipe Detector trying to be implemented on CollectionView with many ViewCells

JPHochbaumJPHochbaum USMember ✭✭✭

My attempt to get the swipe gesture to register currently looks like this. I would love for a swipe anywhere on the collection view to register. Right now my events aren't even registering. In debug mode my program never enters into the methods to handle the swipe events.

` UISwipeGestureRecognizer swipeRightRecognize = new UISwipeGestureRecognizer(this.SwipeRight);
swipeRightRecognize.Direction = UISwipeGestureRecognizerDirection.Right;

        UISwipeGestureRecognizer swipeLeftRecognize = new UISwipeGestureRecognizer(this.SwipeLeft);
        swipeLeftRecognize.Direction = UISwipeGestureRecognizerDirection.Right;

` public void SwipeRight()
//UISwipeGestureRecognizer SwipeGestureRecognizer = new UISwipeGestureRecognizer();
var x = 0;
//SwipeGestureRecognizer.AddTarget(() => this.SwipeHandler(SwipeGestureRecognizer));

    public void SwipeLeft()
        var x = 0;

My only guess is that it isn't registering because the swipes are occurring on the ViewCells in the collectionView. So if that is the case how do I create an event to handle that? I haven't been able to find anything to guide me in the right direction with this.

Sign In or Register to comment.