DottedProgressBar
  • October 2, 2023

Example


To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements


  • iOS 8.0+
  • Swift 3.0+

Installation


DottedProgressBar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod “DottedProgressBar”

Easy to use


Import library

import DottedProgressBar

Initialize DottedProgressBar in one line of code

let progressBar = DottedProgressBar(frame: CGRect(x: 50, y: 50, width: 200, height: 20),
numberOfDots: 6,
initialProgress: 1)
view.addSubview(progressBar)

Custom appearance


let progressBar = DottedProgressBar()
progressBar.appearance = DottedProgressBar.DottedProgressAppearance(
dotRadius: 8.0,
dotsColor: UIColor.orange.withAlphaComponent(0.5),
dotsProgressColor: UIColor.red,
backColor: UIColor.clear
)
view.addSubview(progressBar)
progressBar.frame = CGRect(x: 50, y: 50, width: 200, height: 20)

progressBar.setNumberOfDots(6, animated: false)
progressBar.setProgress(1, animated: false)

Animations


Animations can be called repeatedly because they have theirs own queue. Each animation will wait previous to finish and then will be executed.

self.setProgress(4, animated: true)
self.setNumberOfDots(8, animated: true)

Customize animations


Customize duration of animations and pause between consecutive animations

progressBar.dotsNumberChangeAnimationDuration = 0.6
progressBar.progressChangeAnimationDuration = 0.7
progressBar.pauseBetweenConsecutiveAnimations = 1.0

GitHub


View Github

#animation #ios #progress #progressbar #swift #swift3 #swiftanimation #uiviewcomponents
YOU MIGHT ALSO LIKE...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS