Non-linear property interpolation for interactive transitions

In the implementation of an interactive transition, I'd like to mimic the animated transition that uses the non-linear easing functions. After searching around CA, it looks like interpolation machinery is all hidden behind private APIs.

  • Is there a way to leverage Core Animation to do the grunt work for me?
  • Do I need to roll my own value interpolation?
  • Is there some existing open source lib that does this?

Answers


It turns out that instead of manually modifying all the properties myself, I can schedule the animation normally, then set the layer speed to 0 and control the progress using the layer's timeOffset property. Given the animation duration is 1 second, the percentComplete maps directly to the timeOffset.

I've learned this from the iOS Core Animation: Advanced Techniques by Nick Lockwood.


Need Your Help

Bash script to run php script

php bash shell cron

I have a php script that I want to be run using a bash script, so I can use Cron to run the php script every minute or so.

how to remove empty series from list in Python

python pandas

I have a list which looks something like this.