I am trying to create a vertical progress bar. But the problem is my code is working on IOS11 or Above but on IOS9 it's not working.
On IOS11 Or Above it looks like: enter image description here
But on IOS9 it looks like: enter image description here
My Code:
let progressBar: UIProgressView = {
let prgressView = UIProgressView()
prgressView.progress = 0.7
prgressView.progressTintColor = UIColor(red: 1.0, green: 0.21, blue: 0.33, alpha: 1)
prgressView.trackTintColor = UIColor.blue
prgressView.layer.cornerRadius = 6.5
prgressView.clipsToBounds = true
prgressView.transform = CGAffineTransform(rotationAngle: .pi / -2)
prgressView.translatesAutoresizingMaskIntoConstraints = false
return prgressView
}()
layoutSubview()
override func layoutSubviews() {
super.layoutSubviews()
let width = progressBar.bounds.width
let height = progressBar.bounds.height
progressBar.bounds.size.width = height
progressBar.bounds.size.height = width
}
viewDidLoad()
self.addSubview(progressBar)
progressBar.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
progressBar.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
progressBar.widthAnchor.constraint(equalToConstant: 22.5).isActive = true
progressBar.heightAnchor.constraint(equalToConstant: 250).isActive = true
I am following this tutorial to create vertical progressView: https://www.youtube.com/watch?v=ifekgTtb0rQ&t=1070s