SegmentedProgressBar icon indicating copy to clipboard operation
SegmentedProgressBar copied to clipboard

Configure duration of each segment?

Open HackShitUp opened this issue 7 years ago • 4 comments

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?

HackShitUp avatar Sep 25 '17 01:09 HackShitUp

At the moment that's not possible, only one global duration is possible.

D-32 avatar Sep 25 '17 09:09 D-32

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 avatar Mar 22 '18 18:03 vaishdolly13

@vaishdolly13 what value do we need to set in self.duration before calling super.init in initialiser ?

commando24 avatar Apr 03 '18 11:04 commando24

@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"

vaishdolly13 avatar Apr 21 '18 15:04 vaishdolly13