Partial Curl animation in iOS with Modal Segue

When developing a Xamarin.iOS application, I had to navigate from the first view controller to a second view controller. To do this, I have used a Modal Segue.

The problem was the once reached the second view controller, touching the upper part of the view was unwinding the segue.

I could not understand this behaviour, and my colleague Mark Smith has been able to understand it and point me to the right solution.

 

While the problem is already described in Remove tap recogniser for modal UIView/Partial Curl, the solution is not completely correct (because it completely disable any functionality on the second view controller), the correct solution is found at Partial Curl transition for modal seque in iOS 8.

 

Here is the solution code rewritten in Xamarin/C#:

             public override void ViewDidAppear(bool animated)

             {

                    base.ViewDidAppear(animated);

 

                    foreach (var gesture in View.GestureRecognizers)

                    {

                          if (gesture is UITapGestureRecognizer)

                                 View.RemoveGestureRecognizer(gesture);

                    }

             }

Add comment

Loading