ios - UIPageViewController programmatically allow datasource to be called -


i have uipageviewcontroller displays images transition style scroll. want handle tap , pan gestures in order that, did little hack of putting view on top of uipageviewcontroller , assign tap , pan gesture recognizers. in case, use -setviewcontrollers:direction:animated:completion: perform swipes when detect pan gestures left or right.

my problem when using -setviewcontrollers:direction:animated:completion: datasource methods viewcontrollerbeforeviewcontroller , viewcontrollerafterviewcontroller doesn't called. delegate method -pageviewcontroller:didfinishanimating:previousviewcontrollers:transitioncompleted: doesnt callled.

what have these methods called using setviewcontrollers?

think can uipagecontroller's gesture recognisers, , use them disable or enable uipagecontroller interaction using method of uigesturerecogniser:

- (void)requiregesturerecognizertofail:(uigesturerecognizer *)othergesturerecognizer 

if use setviewcontrollers... methods of datasource not called, because you've provided viewcontrollers. can handle completion of appearing animation in completion block of method. (you can call methods of datasource , delegate self)

upd

when had same task, implemented custom page view (based on uiscrollview in pages state), , used gesture recognisers of scrollview avoid scrolling, while pan gesture recognised inside page. can't remember why i've implemented custom control, maybe because can't find solution same problem. remember page view used datasource views pages. think can implement custom control special logic.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)