Swiftpack.co - anjaeyoung26/DVProgressLabel as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by anjaeyoung26.
anjaeyoung26/DVProgressLabel 0.2.1
The label masked according to progress
⭐️ 0
🕓 5 days ago
iOS
.package(url: "https://github.com/anjaeyoung26/DVProgressLabel.git", from: "0.2.1")

DVProgressLabel

License Platform

Preview

ProgressMaskLabel

Installation

CocoaPods

pod 'DVProgressLabel'

Swift Package Manager

import PackageDescription

let package = Package(
  name: "MyApp",
  dependencies: [
    .package(url: "https://github.com/anjaeyoung26/DVProgressLabel.git", from: "0.2.1")
  ]
)

Usage

Progress

func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { 
    let progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite)
    progressMaskLabel.update(progress: progress)
}

You can detect when progress did finished with didFinishMasking property. It will be true when progress is set to a value greater than or equal to 1.0.

if progressMaskLabel.didFinishMasking {
    // Next step
}

You can also get current progress with progress property.

let progress = progressMaskLabel.progress

Color

progressMaskLabel-usage

You can set stroke color with maskStokeColor property when the label is being masked.

progressMaskLabel.maskStrokeColor = .green

You can set fill color with maskStokeColor property when the label is being masked.

progressMaskLabel.maskColor = .white

License

DVProgressLabel is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 0
Last commit: 3 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

0.2.1
5 days ago

Fix package platform version for iOS.

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