ios - Simulate UIScrollView Deceleration -
i have uipangesturerecognize
use change frame of view. there way simulate deceleration of uiscrollview
or uitableview
when gesture's state uigesturerecognizerstateended
? here current code:
if (pangesture.state == uigesturerecognizerstateended) { [uiview animatewithduration:0.25 delay:0 options:uiviewanimationoptionbeginfromcurrentstate animations:^{ self.view.frame = cgrectmake(182, 0, self.view.frame.size.width, self.view.frame.size.height); } completion:^(bool finished) { if (finished) { //do } }]; }
but not smooth scroll. decelerates until stops point i've set. thanks
session 223 @ wwdc 2012, "enhancing user experience scroll views", covered method use scrollview's behavior , "feel" animate position of different view (without scrollview ever being visible user).
the benefit of method shown in session deceleration match uiscrollview's, , forever.
Comments
Post a Comment