1

I am having diffuculties about bouncies animation effect , whenever i swipe down, The two UI elements swipe down , 1st is container ( which holds UIPickerView ) and it changes coordinate(x,y) and w/h value, second UI is just for pull on/off and I am only applying it's coordinates. I am doing it with FacebookPOP Framework and i also applied bounce effect. First pulling down , 2 UI has a trailing space while keeping in bounce effect. Without change or refresh view controller, second / third's swipe down action occurs as i expected .

My code while swipe down / up looks like that :

if(sender.direction == UISwipeGestureRecognizerDirectionDown)
{

    isDown = YES;

    POPSpringAnimation *bounceForControlView = [POPSpringAnimation animation];

    bounceForControlView.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame];

    bounceForControlView.toValue=[NSValue valueWithCGRect:CGRectMake(0, 241, 320, 42)];

    bounceForControlView.springBounciness = 15;

    bounceForControlView.springSpeed = 10;


    [controlView pop_addAnimation:bounceForControlView forKey:@"bounceForControlView"];

    POPSpringAnimation *bounceForPickerView = [POPSpringAnimation animation];

    bounceForPickerView.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame];

    bounceForPickerView.toValue=[NSValue valueWithCGRect:CGRectMake(0, 64, 320, 177)];

    bounceForPickerView.springBounciness = 15;

    bounceForPickerView.springSpeed = 10;

    [swipeView pop_addAnimation:bounceForPickerView forKey:@"bounceForPickerView"];

    [UIView animateWithDuration:0.7 animations:^() {

        [pullUPImage setAlpha:1.0];

        [self.pullImage setAlpha:0.0];

    }];

    [UIView animateWithDuration:0.7 animations:^() {

        [myPicker setHidden:NO];

    }];

}
if(sender.direction == UISwipeGestureRecognizerDirectionUp)
  {
    isDown = NO;

    [myPicker setHidden:YES];

    popAnimation = [POPSpringAnimation animation];

    popAnimation.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame];

    popAnimation.toValue=[NSValue valueWithCGRect:CGRectMake(0, 64, 320, 0)];

    popAnimation.springBounciness = 5;

    popAnimation.springSpeed = 5;

    [swipeView pop_addAnimation:popAnimation forKey:@"slide"];

    popAnimation = [POPSpringAnimation animation];

    popAnimation.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame];

    popAnimation.toValue=[NSValue valueWithCGRect:CGRectMake(0, 64, 320, 42)];

    popAnimation.springBounciness = 5;

    popAnimation.springSpeed = 5;

    [controlView pop_addAnimation:popAnimation forKey:@"slide"];

    [UIView animateWithDuration:0.5 animations:^() {

        [pullUPImage setAlpha:0.0];

        [self.pullImage setAlpha:1.0];
    }];
}

This is how animation works in realtime :

in action

Onder OZCAN
  • 1,556
  • 1
  • 16
  • 36

0 Answers0