Currently, I am working with UIProgressView
where I need to change the height of the UIProgressView
. I achieve through below code.
extension UIProgressView {
@IBInspectable var barHeight : CGFloat {
get {
return transform.d * 2.0
}
set {
// 2.0 Refers to the default height of 2
let heightScale = newValue / 2.0
let c = center
transform = CGAffineTransform(scaleX: 1.0, y: heightScale)
center = c
self.layer.cornerRadius = 20.0
}
}
}
but when I set cornerRadius
to UIProgressView
not get affected.