UIView animation interaction?

You could try using animateWithDuration:delay:options:animations:completion: and include the option setAnimationBeginsFromCurrentState .

Up vote 0 down vote favorite 1 share g+ share fb share tw.

I have UIView with animated frame size on long press gesture. - (IBAction)longPressGesture:(id)sender { NSTimeInterval duration = 1; CGRect newFrame = self.view. Frame; switch (((UIGestureRecognizer *)sender).

State) { case UIGestureRecognizerStateBegan: newFrame.size. Height += 100; break; case UIGestureRecognizerStateEnded: newFrame.size. Height -= 100; break; default: break; } UIView animateWithDuration:duration animations:^{ self.view.

Frame = newFrame; }; } On tap_begin frame height increase to maximum size (heigh + 100), on tap_end decrease to original size (heigh - 100). The problem is when I tap, frame start to grow and then while growing I release finger and second animation starts from large frame, not from current state. For example frame start to animate from height 200 to 300 and in middle of animation (when frame height is 250) I release finger and frame height immediately sets to 300 and start to decrease to 200.

How can I implement behavior where I can interrupt first animation and start second from curent height (250 for example)? Or behavior where first animation must complete at first and only after that start second animation? Ios animation uiview uikit link|improve this question asked Mar 14 at 13:33Lloyd181799 91% accept rate.

You could try using animateWithDuration:delay:options:animations:completion: and include the option setAnimationBeginsFromCurrentState.

Great! Thank you! – Lloyd18 Mar 14 at 13:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions