SegmentedProgressBar
SegmentedProgressBar copied to clipboard
Configure duration of each segment?
The only workaround I can think of at the moment without testing it is initializing multiple SegmentedProgressBars and laying them out in the view, but that's pretty inefficient. Is there a way to modify the duration of each bar itself?
At the moment that's not possible, only one global duration is possible.
I have updated the code. Now, for every progress bar, you can give different duration. For this, instead of init(numberOfSegments: Int, duration: TimeInterval = 5.0) { We need to pass TimeInterval Array init(numberOfSegments: Int, durationArrValues: [TimeInterval]) { Also in "private func animate(animationIndex: Int = 0) { " function, UIView.animate(withDuration: durationArr[animationIndex] instead of common duration.
@vaishdolly13 what value do we need to set in self.duration before calling super.init in initialiser ?
@commando24 There will be no concept for self.duration. Now, this will be array of duration. Instead of "private let duration: TimeInterval" use private var durationArr = TimeInterval
Also , before super.init instead of "self.duration = duration" this will be "self.durationArr = durationArrValues"