Entry points specific to Animation plugins

writeIOSCodeForInit(varName)

Deprecated. Use keyframeAnimationDescription function instead.

writeIOSCodeForPreparation(varName)

Deprecated. Use keyframeAnimationDescription function instead.

writeIOSCodeForAnimation(varName)

Deprecated. Use keyframeAnimationDescription function instead.

writeIOSCodeForCompletion(varName)

Deprecated. Use keyframeAnimationDescription function instead.

keyframeAnimationDescription(reverse)

Should return an object which contains animation keyframes and other attributes. The object should follow the structure:

{
  "initialTransform": {
    "translateX": <number>,
    "translateY": <number>,
    "rotate": <number>,
    "scaleX": <number>,
    "scaleY": <number>
  },
  "keyframes": [
    {
      "transform": {
        "translateX": <number>,
        "translateY": <number>,
        "rotate": <number>,
        "scaleX": <number>,
        "scaleY": <number>
      },
      "relativeStartTime": <number>,
      "relativeDuration": <number>
    }
  ],
  "repeatCount": <number>
}

Example:

this.keyframeAnimationDescription = function(reverse) {
  var scale1 = (reverse) ? 1.0 : 0.0;
  var scale2 = (reverse) ? 0.0 : 1.0;
  return {
    "initialTransform": {
      "scaleX": scale1,
      "scaleY": scale1
    },
    "keyframes": [
      {
        "relativeStartTime": 0.0,
        "relativeDuration": 1.0,
        "transform": {
          "scaleX": scale2,
          "scaleY": scale2
        }
      }
    ]
  };
}