1. 程式人生 > >CABasicAnimation來做心跳動畫

CABasicAnimation來做心跳動畫

clas col add cal nim ani rep layer 動畫

CABasicAnimation *anim = [CABasicAnimation animation];
    
    anim.keyPath = @"transform.scale";
    anim.toValue = @0.5;
    anim.repeatCount = MAXFLOAT;
    
    [_heartImageV.layer addAnimation:anim forKey:nil];

CABasicAnimation來做心跳動畫