diff --git a/Sources/Shared/Views/DotAnimation.swift b/Sources/Shared/Views/DotAnimation.swift index 9cda32e30765b2220e40aa1aa41d7c68a7e9a044..24124daf02fe71b4d14b88ac730265e777012dd1 100644 --- a/Sources/Shared/Views/DotAnimation.swift +++ b/Sources/Shared/Views/DotAnimation.swift @@ -1,5 +1,6 @@ -import UIKit import AppResources +import SwiftUI +import UIKit public final class DotAnimation: UIView { let leftDot = UIView() @@ -71,3 +72,21 @@ public final class DotAnimation: UIView { if rightValue > factor || rightValue < 10 { rightInvert.toggle() } } } + +extension DotAnimation { + public struct SwiftUIView: UIViewRepresentable { + public init(color: UIColor = Asset.brandPrimary.color) { + self.color = color + } + + public var color: UIColor + + public func makeUIView(context: Context) -> DotAnimation { + DotAnimation() + } + + public func updateUIView(_ uiView: DotAnimation, context: Context) { + uiView.setColor(color) + } + } +}