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...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...