今回の内容
 
 
コードと簡単解説
import Lottie 
           ~~~~~~~~~~省略~~~~~~~~~~
    override func viewDidLoad() {
        super.viewDidLoad()
        let animationStartButton = {() -> UIButton in
            
            let button = UIButton(frame: CGRect(x: view.frame.maxX / 4, y: view.frame.maxX / 3, width: view.frame.width / 2, height: view.frame.height / 20))
            button.setTitle("Start", for: .normal)
            button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 20)
            button.titleLabel?.textColor = .white
            button.backgroundColor = .systemGreen
            button.layer.cornerRadius = 15.0
            button.layer.shadowOffset = CGSize(width: 5, height: 5)
            button.layer.shadowRadius = 5.0
            button.layer.shadowOpacity = 0.8
            button.addTarget(self, action: #selector(showLottie), for: .touchDown)
            return button
        }()
        view.addSubview(animationStartButton)       
    }
    
    @objc func showLottie(sender:UIButton){
        
        let lottieAnimationView = AnimationView() 
        lottieAnimationView.frame = CGRect(x: view.frame.maxX / 4, y: view.frame.maxY / 4, width: view.frame.width / 2, height: view.frame.width / 2)
        lottieAnimationView.backgroundColor = .clear
        lottieAnimationView.animation = Animation.named("ダウンロードしてきたデータの名前") //表示するアニメーションを設定
        lottieAnimationView.contentMode = .scaleToFill
        lottieAnimationView.loopMode = .loop //繰り返しアニメーションをします 
        lottieAnimationView.play() //アニメーションを開始します
        view.addSubview(lottieAnimationView)
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
            
            lottieAnimationView.removeFromSuperview() //画面から消します
            lottieAnimationView.stop() //アニメーションを停止します 
        }
           ~~~~~~~~~~省略~~~~~~~~~~
終わり
ご指摘、ご質問などありましたら、コメントまでお願い致します。