Swiftpack.co - moliya/GradientProgressView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
moliya/GradientProgressView
一个简单的进度条控件
.package(url: "https://github.com/moliya/GradientProgressView.git", from: "1.5.0")

GradientProgressView

一个简单的进度条控件

示例图

example

  • 支持设置纯色进度条、渐变进度条
  • 支持设置进度条的圆角
  • 支持设置进度条的内间距
  • 支持自定义高度、背景颜色
  • 支持设置动画时长、动画时间函数
  • 支持监听进度的更新回调

要求

  • Swift 5.0
  • Xcode 11
  • iOS 8.0+

使用

设置圆角

//设置进度条圆角
progressView.progressCornerRadius = 5

设置内间距

//设置内间距
progressView.progressEdgeInsets = UIEdgeInsets(top: 4, left: 5, bottom: 4, right: 5)

设置纯色和渐变色

//设置纯色和渐变色
progressView1.progressColors = [.green]
progressView2.progressColors = [.green, .red]

设置动画时间时长

//动画时间
progressView.animationDuration = 1

设置动画时间函数

//动画时间函数
progressView.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)

设置动画更新回调

//动画更新回调
progressView.progressUpdating = {[unowned self] progress, frame in
    //在这里可以获得当前的进度百分比和进度条的frame
    print(progress)
    print(frame)
}

设置进度

//设置进度
progressView.setProgress(0.8, animated: true)

集成

CocoaPods
pod 'KFGradientProgressView'
Swift Package Manager
dependencies: [
    .package(url: "https://github.com/moliya/GradientProgressView", from: "1.4.0")
]

GitHub

link
Stars: 14
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Support Objective-C
4 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics