ios - How to have UIScrollView animate off screen when dragged -


so have uiviewcontroller , have uiscrollview inside of it, has ui elements.

i want user able drag uiscrollview , down, when drags past threshold, want animate off screen. there needs springiness though. tried using -(void)scrollviewdidscroll: couldn't seem right. thoughts?

enter image description here

in scroll view delegate method -(void)scrollviewdidscroll:(uiscrollview *)scrollview; observe scrollview.contentoffset.y , trigger animation when reaches expected y position.

for example:

cgfloat ytranslation = -200.f; // value want shift  [uiview animatewithduration:0.35 animations:^{      scrollview.transform = cgaffinetransformmaketranslation(0, ytranslation); } completion:^(bool finished) {      // code after completion }]; 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -