Open dhaval-dobariya opened 4 years ago
I want stepper like this one
And I have written below code:
func setupProgressBarWithDifferentDimensions() { progressBarWithDifferentDimensions = FlexibleSteppedProgressBar() progressBarWithDifferentDimensions.translatesAutoresizingMaskIntoConstraints = false self.view.addSubview(progressBarWithDifferentDimensions) // iOS9+ auto layout code let horizontalConstraint = progressBarWithDifferentDimensions.centerXAnchor.constraint(equalTo: self.view.centerXAnchor) let verticalConstraint = progressBarWithDifferentDimensions.topAnchor.constraint( equalTo: view.topAnchor, constant: 450 ) let widthConstraint = progressBarWithDifferentDimensions.widthAnchor.constraint(equalToConstant: 320) let heightConstraint = progressBarWithDifferentDimensions.heightAnchor.constraint(equalToConstant: 25) NSLayoutConstraint.activate([horizontalConstraint, verticalConstraint, widthConstraint, heightConstraint]) progressBarWithDifferentDimensions.numberOfPoints = 5 progressBarWithDifferentDimensions.lineHeight = 5 progressBarWithDifferentDimensions.progressLineHeight = 6 progressBarWithDifferentDimensions.radius = 16 progressBarWithDifferentDimensions.progressRadius = 16 progressBarWithDifferentDimensions.delegate = self progressBarWithDifferentDimensions.selectedBackgoundColor = progressColor progressBarWithDifferentDimensions.backgroundShapeColor = UIColor.lightGray // progressBarWithDifferentDimensions.centerLayerDarkBackgroundTextColor = UIColor.green // progressBarWithDifferentDimensions.centerLayerTextFont = UIFont.systemFont(ofSize: 17) progressBarWithDifferentDimensions.selectedOuterCircleLineWidth = 0.0 progressBarWithDifferentDimensions.completedTillIndex = 2 progressBarWithDifferentDimensions.currentIndex = 2 progressBarWithDifferentDimensions.stepTextColor = UIColor.yellow progressBarWithDifferentDimensions.currentSelectedTextColor = UIColor.white progressBarWithDifferentDimensions.centerLayerTextColor = UIColor.gray }
I want stepper like this one
And I have written below code: