Skip to content

VB10/LottieSwiftAdapt

Repository files navigation

Lottie IOS To Adapt New Version

lottie-gif

Installiton

cocoa-lottie-ios

How to use

  • Go to download sample lottie json. lottie-bird

  • You craete folder then into this json.

  • You move to folder in app project also check Create folder references box. alt

  • If you use storyboard

    • First you can declare uiview and change class AnimationView and module is Lottie

    • alt

    • Now you can uiview relataions viewcontroller with storyboard.

    • Lottie must be requried init functions. Write this line in viewdidload

        let animation = Animation.named("bird", subdirectory: "TestAnimations")
        lottie.animation = animation
        lottie.contentMode = .scaleAspectFit

And finaly call play functions in viewdidappear

    lottie.play(fromProgress: 0,
                    toProgress: 1,
                    loopMode: LottieLoopMode.playOnce,
                    completion: { (finished) in
                        if finished {
                            print("Animation Complete")
                        } else {
                            print("Animation cancelled")
                        }
        })
  • You want to use programmatic lottie files, look this lottie-swift

Releases

No releases published

Packages

No packages published