Elegant and Animated Progress Bar designed for tracking document reading progress in Swift.
It splits Progress Track with Remaining Track. This UI component integrates seamlessly with SwiftUI and UIKit, offering a customizable and visually appealing way to display a reading progress.
SPM (Swift Package Manager)
To install ReaderProgressView via Swift Package Manager, add the following to your Package.swift:
dependencies: [
.package(url: "https://github.com/mohamed-arradi/ReaderProgressView.git", from: "0.0.2")
]
SwiftUI Integration To use ReaderProgressView in a SwiftUI view, you can initialize it with the desired progress, track color, and progress color.
import SwiftUI
import ReaderProgressView
struct ContentView: View {
@State private var progress: CGFloat = 0.5
var body: some View {
VStack {
ReaderProgressView(progress: $progress,
trackColor: .gray.opacity(0.3),
progressColor: .blue,
spaceBetweenBars: 8.0)
.frame(height: 10) // Set your own sizing
// Add your own UI to increase / decrease progress value
Button("Increase Progress") {
withAnimation {
progress = min(progress + 0.1, 1.0)
}
}
}
}
}
ReaderProgressView.Light.Mode.-.Demo.mov
ReaderProgressView.Dark.Mode.-.Demo.mov
You are most welcome to create any PR to increase configuration capability or any other ideas are most welcome