play() | Begins playback from the current animation position. |
play(fromFrame: Float) | Begins playback from a specific animation frame. |
play(fromProgress: Float) | Begins playback from a specific animation progress (0…1). |
pause() | Pauses the animation without resetting its position. |
stop() | Halts playback and returns the animation to its initial frame. |
setSpeed(speed: Float) | Sets the playback speed with the given multiplier. |
setLoop(loop: Bool) | Configures whether the animation should loop continuously. |
setFrame(frame: Float) | Directly navigates the animation to a specified frame. |
setProgress(progress: Float) | Directly navigates the animation to a specified progress (0…1). |
loadAnimationById(_ animationId: String) | Loads the animation by id. Animation id’s are visible inside the manifest, recoverable via the manifest() method. |
setMode(mode: Mode) | Sets the animation play mode. |
setSegments(segments: (Float, Float)) | Sets the start and end frame of the animation. |
setBackgroundColor(bgColor: CIImage) | Sets the background color of the animation. |
setFrameInterpolation(_ useFrameInterpolation: Bool) | Uses frame interpolation or not. |
resize(width: Int, height: Int) | Manually resizes the animation. |
setTheme(_ themeId: String) | Loads a theme. Only available with .lottie files. |
setThemeData(_ themeData: String) | Loads the passed theming data. |
resetTheme() | Removes the currently loaded theme. Only available with .lottie files. |
setMarker(marker: String) | Sets a marker for the animation timeline. |
setAutoplay(autoplay: Bool) | Sets whether the animation should autoplay. |
setSlots(_ slots: String) | Sets slots for the animation (theme/text replacement). |
getLayerBounds(layerName: String) -> [Float] | Returns the bounds of a specific layer. |
tick() -> CGImage? | Requests a frame and renders it if necessary. Returns the current frame as CGImage. |
frameImage() -> CGImage? | Generates and returns the current frame image as CGImage. |
render() -> Bool | Renders the current frame. Returns true if rendering was successful. |