You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
761 B

2 years ago
  1. //
  2. // CompatibleAnimationKeypath.swift
  3. // Lottie_iOS
  4. //
  5. // Created by Tyler Hedrick on 3/6/19.
  6. //
  7. import Foundation
  8. #if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst)
  9. /// An Objective-C compatible wrapper around Lottie's AnimationKeypath
  10. @objc
  11. public final class CompatibleAnimationKeypath: NSObject {
  12. // MARK: Lifecycle
  13. /// Creates a keypath from a dot separated string. The string is separated by "."
  14. @objc
  15. public init(keypath: String) {
  16. animationKeypath = AnimationKeypath(keypath: keypath)
  17. }
  18. /// Creates a keypath from a list of strings.
  19. @objc
  20. public init(keys: [String]) {
  21. animationKeypath = AnimationKeypath(keys: keys)
  22. }
  23. // MARK: Public
  24. public let animationKeypath: AnimationKeypath
  25. }
  26. #endif