3

I have been using the Facebook POP engine (https://github.com/facebook/pop) with great results since they launched it earlier this year.

Until now I haven't needed to implement animation on any custom properties, however I now have a situation where I would like to animate a CAShapeLayer CGPath property (which isn't one of the standard properties).

This is the suggested method...

prop = [POPAnimatableProperty propertyWithName:@"com.foo.radio.volume" initializer:^(POPMutableAnimatableProperty *prop) {

// read value
prop.readBlock = ^(CAShapeLayer *obj, CGFloat values[]) {
  values[0] = [obj volume];
};

// write value
prop.writeBlock = ^(CAShapeLayer *obj, const CGFloat values[]) {
  [obj setVolume:values[0]];
};

// dynamics threshold
prop.threshold = 0.01;

}];

anim.property = prop;

But I can't work out to apply this to the CGPath property.

Any suggestions greatly received.

Cezar
  • 55,636
  • 19
  • 86
  • 87
Michael Platt
  • 516
  • 1
  • 5
  • 13

0 Answers0