NSLayoutConstraint.constant ignoring animation

前端 未结 4 714
情歌与酒
情歌与酒 2021-01-31 11:09

I\'m creating an autolayout-friendly split view class for one of my applications. Among its various features is that it can collapse panes, and can animate their collapse, much

4条回答
  •  礼貌的吻别
    2021-01-31 11:46

    The completion handler is firing immediately because it thinks there aren't any animations that need to be run. I would check and confirm that the animation you created is still attached to the view. By default CABasicAnimation is set to remove itself upon completion by way of the removedOnCompletion property it inherits from CAAnimation (which by default is set to YES).

    you'll want to

    anim.removedOnCompletion = NO;
    

提交回复
热议问题