ios - PageViewController scroll bug (over scrolls) -


i following tutorial here , had make few changes fit project (code of variation here, sorry put on github because it's bit lengthy copy , paste). when swipe right last vc, automatically closes on sight. other times works if swipe last vc stays there until swipe right again close it. i've placed print statements in code me find bug is. here print statements when works , when doesn't work. looking @ logs, since exact same code accessed in same order, i'm not sure how fix bug. problem doesn't occur when transition style pagecurl instead of scroll.

first need know how pageviewcontrollers work.
after first page loaded, moment start scroll try load next page. first page. after reach page preload next page (depending on direction) , have ready.

in case when reach page 5 pageviewcontroller try preload next page leads part of code

guard orderedviewcontrollerscount != nextindex else {          print("last item in coachamrks going dismiss")         self.dismissviewcontrolleranimated(true, completion: nil)          return orderedviewcontrollers.first     } 

and dismiss viewcontroller reach page 5.
not bug. it's default behavior of pageviewcontroller.

i think reason find behaving way wrongly expected when scroll through pages fast enough pageviewcontroller stops preloading pages performance reasons.

the way achieve want hackish way of accessing scrollview inside of pageviewcontroller not safe , might break app if apple changes architecture of pageviewcontrollers in future update.

i suggest put button in last page , use dismiss pageviewcontroller.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -