Skip to content

A tutorial for using Lottie animation with watchOS in SwiftUI

Notifications You must be signed in to change notification settings

eharrison/LottieTutorialWatchOS-SwiftUI

Repository files navigation

Lottie Tutorial for watchOS with SwiftUI

About

This example demonstrates the usage of Lottie animations for watchOS with SwiftUI.

Steps to add it to your project:

struct ContentView: View {
    @ObservedObject var viewModel: LottieViewModel = .init()
    
    var body: some View {
        Image(uiImage: viewModel.image)
            .resizable()
            .scaledToFit()
            .onAppear {
                       self.viewModel.loadAnimation(url: URL(string: "https://assets8.lottiefiles.com/packages/lf20_Zz37yH.json")!)
                   }
    }
}

Requirements

  • Swift 5.0
  • watchOS 6.0+

Happy coding! 😀

About

A tutorial for using Lottie animation with watchOS in SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages