Can a UIScreenEdgePanGestureRecognizer be added to a subheading that is not near the edge of the screen?

I downloaded this example from github: It seems to work fine. However, if I change the left frame to green to say 30 points from the supervisor in the storyboard (not the same with supervisor as in the example) and change this code

[self.view addGestureRecognizer:leftEdgeGesture];



[_edgeView addGestureRecognizer:leftEdgeGesture];


the gesture does not respond. I think you cannot add a UIScreenEdgePanGestureRecognizer to the subview if the subview edge is not near the edge of the screen, but I need to know that I am doing something wrong. Thanks to


source to share

1 answer

Yes you are right. It only works for views that touch the edge.



All Articles