A Simple Swift Progress Using Lottie Json
IGProgress Lottie - Swift
Manager of progress using Lottie JSON, simple implemetation for your project Xcode.
Important Info:
Create folder into project:
- For example MyJson.
- Add your json animation lottie. You can get it https://lottiefiles.com/
Implementation
Code:
import IGLottieProgress
//Insert your json resource into project.
IGProgress.config.urlLottieJson = "YOUR JSON LOTTIE NAME"
// Set a time out for finish process.
IGProgress.config.timer = 8
//End your progress loading in any func
self.IGPStartLoading(config: IGProgress.config) // <--- Start the progress
Start Progress:
self.IGPStartLoading(config: IGProgress.config)
Remove progress:
self.IGPFinishLoading()
Option table:
| Config | Type | Description |
|---|---|---|
| urlLottieJson | String | Insert your json resource into project. |
| timer | Int | Set a time out for finish process. |
| message | String | Do your need add any message use this option |
| sizeTextMessage | CGFloat | Resize the text message |
| fontColorMessage | UIColor | Change color text message |
| backgroundColor | UIColor | Set color background for your windows. |
| alpha | CGFloat | Set apha color for windows, this normal is 0.5 |
| contentMode | UIView.ContentMode | If do you need scale the animation use content mode |
| hight | Int | Set new size hight |
| width | Int | Set new size width |
| animationSpeed | CGFloat | Animation speed |