# 实战stroke动画

iOS支持对许多属性进行动画操作，比如center，rotation等等。其中有两个属性常常被人忽略，但又能做出很有趣的效果，那就是strokeStartstrokeEnd。最近在做一个小东西的时候想要用动画在搜索图标与返回图表之间切换，效果如下：

### 动起来－第一次尝试

The value of this property must be in the range 0.0 to 1.0. The default value of this property is 0.0.

Combined with the strokeEnd property, this property defines the subregion of the path to stroke. The value in this property indicates the relative point along the path at which to begin stroking while the strokeEnd property defines the end point. A value of 0.0 represents the beginning of the path while a value of 1.0 represents the end of the path. Values in between are interpreted linearly along the path length.

### 动起来－别闪来闪去了

Unlike an implicit animation, which updates the layer object’s data value, an explicit animation does not modify the data in the layer tree.

Share Comments