facebookarchive / pop

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

POPBasicAnimation with property kPOPViewFrame doesn't work on macOS Sierra GM #333

Closed rurza closed 8 years ago

rurza commented 8 years ago
    self.artistViewOriginalRect = self.window.coverView.artistView.frame;
    self.changeTrackAnimation = YES;
    CALayer *layer = self.window.coverView.titleLabel.layer;
    layer.opacity = 0;

    __weak typeof(self) weakSelf = self;
    POPBasicAnimation *showFullInfoAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewFrame];
    showFullInfoAnimation.toValue = [NSValue valueWithRect:self.window.coverView.frame];
    showFullInfoAnimation.completionBlock = ^(POPAnimation *animation, BOOL completion) {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [weakSelf hideFullTrackInfo];
        });
        [self.window.coverView.artistView pop_removeAllAnimations];
    };
    [self.window.coverView.artistView pop_addAnimation:showFullInfoAnimation forKey:@"frame"];
    weakSelf.artistLabel.stringValue = [NSString stringWithFormat:@"%@", track.artist];
    weakSelf.trackLabel.stringValue = [NSString stringWithFormat:@"%@", track.trackName];
    [self updateHeightForLabels];
    [self updateOriginsOfLabels]

everything is fine on 10.11

rurza commented 8 years ago

My bad. I was using constraint for height for self.window.coverView.artistView. And this constraint prevent frame to resize. Workaround is to animate the constraint value :) So bug was actually in 10.11 and it's fixed now in 10.12