facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

problem with same animation #417

Open make1a opened 5 years ago

make1a commented 5 years ago

when the animation is not finish,run other animation,the first one will be stop。how can I solve this problem

- (void)clickBottomButtonAction:(UIButton *)sender{

//    self.userInteractionEnabled = NO;
    for (UIButton *button in self.bottomButtonArray) {
        CGRect frame = button.frame;
        frame.origin.y = _originY;
        button.frame = frame;
        button.selected = NO;
    }
    sender.selected = YES;
    POPSpringAnimation *anSpring = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionY];
    anSpring.fromValue = @(_originY);
    anSpring.toValue = @(_originY+10);
    anSpring.delegate = self;
    anSpring.springBounciness = 20.0f;
    [sender pop_addAnimation:anSpring forKey:[NSString stringWithFormat:@"BottomButtonPositionY%ldld",(long)sender.tag]];
//    anSpring.completionBlock = ^(POPAnimation *anim, BOOL finished) {
//        if (finished) {
//            self.userInteractionEnabled = YES;
//        }
//    };

}

make1a commented 5 years ago

1536312336281