带有标签和形状的分步进度视图。UIActivityIndicatorView 和 UIProgressView 的良好替代品

步进视图

带有标签和形状的分步进度视图。UIAactivityIndicatorView和UIProgressView的一个很好的替代品。

迅捷版
构建状态
许可证
兼容可可豆荚
平台
欢迎公关

用法

let progressView   = StepProgressView(frame: view.bounds)
progressView.steps = ["First", "Second", "Third", "Last"]
progressView.details = [0: "The beginning", 3: "The end"] // appears below step title

progressView.currentStep = 0 // started first step
...
progressView.currentStep = 4 // all done
迅速

SwiftUI

Use from the swiftui branch.StepsView

Changing Appearance

The properties below can be set in Interface Builder, in code, or through a UIAppearance proxy (e.g., ).StepProgressView.appearance().stepShape = .circle

Shape of the step icons:

progressView.stepShape = .circle
progressView.firstStepShape = .rhombus
progressView.lastStepShape = .square
// also available: .triangle, .downTriangle
Swift

Text fonts and sizes:

progressView.textFont = myFont
progressView.detailFont = anotherFont
Swift

Line size spacing:

progressView.lineWidth = 2.5
progressView.verticalPadding = 8 // between steps (0 => default based on textFont)
progressView.horizontalPadding: 8 // between shape and text (0 => default based on textFont)
Swift

Colors:

progressView.tintColor = myGeneralTintColor

// alternatively:

progressView.currentStepColor = .red
progressView.pastStepColor = .gray
progressView.futureStepColor = .gray

progressView.currentStepFillColor = .yellow
progressView.pastStepFillColor = .gray
progressView.futureStepFillColor = .lightGray

progressView.currentTextColor = .blue
progressView.pastTextColor = .gray
progressView.futureTextColor = .lightGray
progressView.currentDetailColor = .cyan // nil => use currentStepColor
Swift

Installation

CocoaPods:

pod 'StepProgressView'
Ruby

Legacy versions:

Swift version StepProgressView version
4.0 (Xcode 9.4) pod 'MiniLayout', '~> 1.2.1'
pod 'StepProgressView', '~> 1.4.1'
3 pod 'MiniLayout', '~> 1.1.0'
pod 'StepProgressView', '~> 1.3.0'
2.3 pod 'MiniLayout', '~> 1.0.1'
pod 'StepProgressView', '~> 1.2.1'

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/yonat/StepProgressView", from: "1.5.7")
]
Swift

Meta

@yonatsharon

https://github.com/yonat/StepProgressView

GitHub

https://github.com/yonat/StepProgressView