Skip to content

mohamed-arradi/ReaderProgressView

Repository files navigation

ReaderProgressView

Swift Package Manager Platforms

Buy Me A Coffee
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.

ReaderProgressView

Installation

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")
]

Usage

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)
                }
            }
        }
    }
}

Demo

Light Mode

ReaderProgressView.Light.Mode.-.Demo.mov

Dark Mode

ReaderProgressView.Dark.Mode.-.Demo.mov

Contribution

You are most welcome to create any PR to increase configuration capability or any other ideas are most welcome

Buy Me A Coffee

About

SwiftUI Elegant and Animated Progress Bar designed for tracking reading progress (PDFs, etc)

Topics

Resources

License

Stars

Watchers

Forks

Languages