ios - UIScrollView pass dragging to main view -


i have next trouble , hope give me advice handle it.

i have page controller w/ vertical scrolling. inside of page view use few component 1 of them uiscrollview. in order scroll between pages should drag except uiscrollview, because scrollview catch events , prevent page controller them.

so question, how possible pass drag event uipagecontrollerview uiscrollview.

for example, when scroll content of uiscrollview reach top, pass dragging page controller change page. , vise versa, if reach end of content of uiscrollview next dragging handled pagecontroller change page.

any advises appreciated. thanks.

what want sounds awful lot pull refresh technique, pull down page latest tweets/facebook posts/lemon pie recipes/whatever. instead of refreshing, want event trigger segue new page. default built in 1 works uitableview there lot of libraries let use uiscrollview. here's example:

http://mt.gomiso.com/2012/03/22/yet-another-pull-to-refresh-library/

you take them apart , take or use them as-is, can't determine want.


also try dig in little further following uiscrollview method:

-(void)scrollviewdidenddragging:(uiscrollview *)scrollview willdecelerate:(bool)decelerate; 

then see value contentoffset has @ point.

now if want see scrollview within uipageviewcontroller implement uiscrollviewdelegate protocol on uipageviewcontroller , set viewcontroller delegate uiscrollview:

https://developer.apple.com/library/ios/documentation/uikit/reference/uiscrollviewdelegate_protocol/reference/uiscrollviewdelegate.html

code bit this:

.h:

@interface viewcontroller : uipageviewcontroller<uiscrollviewdelegate>  @property (weak, nonatomic) iboutlet uiscrollview *scrollview; // rest of properties  @end 

.m:

- (void)viewdidload; {     // tell scrollview want delegate     self.scrollview.delegate = self; }  - (void)scrollviewdidenddragging:(uiscrollview *)scrollview willdecelerate:(bool)decelerate; {     // read self.scrollview.contentoffset , see if has been pulled out of bounds     // if is, segue } 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -