iOS Swift Lottie Easy Aceess 快速上手Lottie

今天就優化你的APP UI

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

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

3. 做一個Meth (func) 出來

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

4.呼叫方法 並讓他播放

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

APP U化順利

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mario tsai

Mario tsai

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