Mario tsai
2 min readAug 20, 2020

iOS Swift Lottie Easy Aceess 快速上手Lottie

今天就優化你的APP UI

  1. pod Lottie 及 將你的Lottie Json檔案放入專案當中
Lottie

2. 宣告一個 繼承AnimationView的 常數或是變數

3. 做一個Meth (func) 出來

設定載入哪個動畫Json檔案 -> 將動畫塞到哪一個View裡面 -> 播放幾次 (通常 .once 或是 .loop) -> 播放速度 -> 加入VIew

4.呼叫方法 並讓他播放

這邊要注意,因為之前已經有addSubView了,所以每次載入的時候記得移除,不然就一直疊一直疊……

APP U化順利

Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.