Files
2025-01-28 12:28:03 +08:00

32 lines
654 B
Swift

//
// LottieView.swift
// VPNUI
//
// Created by Mac on 2024/9/26.
//
import Foundation
//import Lottie
import SwiftUI
import Lottie
struct LottieView: UIViewRepresentable {
var animationFileName: String
let loopMode: LottieLoopMode
func updateUIView(_ uiView: UIViewType, context: Context) {
}
func makeUIView(context: Context) -> Lottie.LottieAnimationView {
let animationView = LottieAnimationView(name: animationFileName)
animationView.loopMode = loopMode
animationView.play()
animationView.contentMode = .scaleAspectFit
return animationView
}
}