项目作者: AmeddahAchraf

项目描述 :
🚀 Customizable Circular/Linear progress bar Package that supports animated text, built with SwiftUI
高级语言: Swift
项目地址: git://github.com/AmeddahAchraf/Progress-Bar-SwifttUI.git
创建时间: 2020-07-28T14:58:08Z
项目社区:https://github.com/AmeddahAchraf/Progress-Bar-SwifttUI

开源协议:

下载


ProgressBar SwiftUI

Fully customizable Circular/Linear progress bar that supports animated text, built with SwiftUI

Demo



Instalation

It requires iOS 13 and Xcode 11

In Xcode go to File -> Swift Packages -> Add Package Dependency and paste in the repo’s url: https://github.com/AmeddahAchraf/Progress-Bar-SwifttUI

Usage:

import the package in the file you would like to use it: import Progress_Bar

You can costumize the the progress bar with different arguments

  1. //Circular Bar
  2. CircularProgress(
  3. percentage: CGFloat,
  4. fontSize: CGFloat,
  5. backgroundColor: Color,
  6. fontColor: Color,
  7. borderColor1: Color,
  8. borderColor2: LinearGradient,
  9. borderWidth: CGFloat)
  10. //Linear Bar
  11. LinearProgress(percentage: CGFloat, backgroundColor: Color, foregroundColor: LinearGradient)

Example:

  1. CircularProgress(percentage: 0.5,
  2. fontSize: 25,
  3. backgroundColor: .white,
  4. fontColor : .black,
  5. borderColor1: .blue,
  6. borderColor2: LinearGradient(gradient: Gradient(colors: [.pink, .blue]),startPoint: .top, endPoint: .bottom),
  7. borderWidth: 20
  8. )
  9. .frame(width: 200, height: 200)
  10. LinearProgress(percentage: self.percent, backgroundColor: .gray, foregroundColor: LinearGradient(gradient: Gradient(colors: [.pink, .pink]),startPoint: .leading, endPoint: .trailing))
  11. .frame(height: 50)

Features

  • Fully customizable.
  • Uses AnimatableModifier to animate the text.
  • Scalable TextView.