iphone - Update current page number after page transition animation -
right updating currentpagenumber when turning page on using statement
[self displaycurrentindex:currentindex + 1]; in below method. updates current pagenumber when page not displayed yet. why want update once page transition animation done.
i want should update cureent page number when transition animation done. how can write in code update current pagenumber after page transition animation done.
- (uiviewcontroller *)pageviewcontroller:(uipageviewcontroller *)pageviewcontroller viewcontrollerafterviewcontroller:(uiviewcontroller *)viewcontroller { nsstring *path = [[nsbundle mainbundle] pathforresource:@"pages" oftype:@"pdf"]; nsurl *pdfurl = [nsurl fileurlwithpath:path]; pdfdocument = cgpdfdocumentcreatewithurl((__bridge cfurlref)pdfurl); contentviewcontroller = [[contentviewcontroller alloc] initwithpdfatpath:path]; currentindex = [modelarray indexofobject:[(contentviewcontroller *)viewcontroller page]]; if (currentindex == totalpages - 1) { return nil; } contentviewcontroller.page = [modelarray objectatindex:currentindex + 1]; [self displaycurrentindex:currentindex + 1]; return contentviewcontroller; } thanks help.
uipageviewcontrollerdelegate has following method:
pageviewcontroller:didfinishanimating:previousviewcontrollers:transitioncompleted:
assign delegate object uipageviewcontroller, , update display of page number within method.
Comments
Post a Comment