mardi 24 mars 2015

Detecting a Pan Gesture moving in to UIPageViewController from another view

I have a UIPageViewController displaying content that has a slightly narrower aspect than an iPad in portrait mode. As such I have black bars on either side of the UIPageViewController. The black bars of course belong to the UIPageViewController's superview. This is as intended.


My question is purely a matter of user interaction polish. Currently if you wish to turn a page using UIPageViewController's in built pan/drag gesture it works fine as long as you start your touch within the UIPageViewController's view. But, if you start by placing your finger on either of the black bars, then without releasing move it in to the UIPageViewController's view, no page turning animation is activated.


I understand why this happens as the superview owns the touch that starts in the black bars, and it's standard behaviour that UIViews aren't involved with unreleased touches that move in from another view. But in this case I do want that to happen. i.e. I'd like the UIPageViewController to activate the page turn as soon as the finger moves into its view.




Aucun commentaire:

Enregistrer un commentaire