Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,53 @@
//
// AnimationImageProvider.swift
// Lottie_iOS
//
// Created by Alexandr Goncharov on 07/06/2019.
//
import Foundation
// MARK: - AnimationTextProvider
/// Text provider is a protocol that is used to supply text to `AnimationView`.
public protocol AnimationTextProvider: AnyObject {
func textFor(keypathName: String, sourceText: String) -> String
}
// MARK: - DictionaryTextProvider
/// Text provider that simply map values from dictionary
public final class DictionaryTextProvider: AnimationTextProvider {
// MARK: Lifecycle
public init(_ values: [String: String]) {
self.values = values
}
// MARK: Public
public func textFor(keypathName: String, sourceText: String) -> String {
values[keypathName] ?? sourceText
}
// MARK: Internal
let values: [String: String]
}
// MARK: - DefaultTextProvider
/// Default text provider. Uses text in the animation file
public final class DefaultTextProvider: AnimationTextProvider {
// MARK: Lifecycle
public init() {}
// MARK: Public
public func textFor(keypathName _: String, sourceText: String) -> String {
sourceText
}
}