- 支持SwiftUI预览Lottie动画
- iOS13.0 or later
- In Xcode, open your project and navigate to File > Swift Packages > Add Package Dependency...
- Paste the repository URL and follow the prompts to add the library to your project.
import SwiftUI
import LottieSwiftUI
struct ContentView : View {
var name: String = "LottieLogo1"
var body: some View {
LottieAnimationView(name: name).play()
}
}