limit panning gesture

Hi.

I have been reading on several sites to try and find a way to limit the pangesture so that it won't allow a user to pan off the screen. One way I thought of trying was to not allow to pan unless the user is using the pinch gesture. Not sure how to implement that.


While reading, I read about "StickyCornersViewController" and I can't quite understand enough to implement that either.


Does anyone have suggestions on where to look to read up on this (limiting panning to not pan right off the screen; or to only pan if pinching)? Or does someone have sample code to write for that?


Thanks.

Replies

A limited pan is just a swipe, I think. Check the docs.

A suggestion, if I understand well what you want to do.


Why wouldn't you Implement this is the .Changed and .Ended parts of the gesture handler, by testing that you are not off screen ? You could also force a rebound if getting too close to the border,