AppleCAMediaTimingFunction - UBogun/Xojo-iosLib GitHub Wiki

Inherits from AppleObject
Memory leak check: slight leak
Status: complete

This is an implementation of CAMediatimingFunction, a helper class for Core Animations. You use it only in conjunction with AppleCALayer animations to attain different timing functions. Technically a Bézier curve is plotted going through four control points, two of them being fixed start- and endpoints. This curve maps the position in time during an animation. Mostly you will use one of the four default values, so don't woory about the Bézier thing too much …

Constructor

Constructor (Timing As TimingFunction): Returns one of the default timing functions: Default, EaseIn, EaseOut, EaseInEaseOut, Linear. Ths constructor uses a class initializer and like found on other classes, there is a slight memory leak connected to it. Use the shared property constants instead, it will be much faster too.
You should consider buffering custom timing functions too. They are not released fully too although I chose the instance initializer (but you'd have to create tons of them to notice the leak).

Constructor (c1x As Single, c1y As Single, c2x As Single, c2y As Single): Returns a timing function that goes through the control points c1 and c2 (both between (0,0) and (1,1)).

Properties

ControlPoint0, ControlPoint1, ControlPoint2, ControlPoint3 As Xpjo.Core.points (read-only): The four control points like above.

Shared Properties

DefaultFunction, EaseInEaseOutFunction, EaseInFunction, EaseOutFunction, LinearFunction As AppleCAMediaTimingFunction: Constants for the default functions which help reduce memory leak and increase performance.