I have a UISlider which goes from 0 to 275. I want to use the slider to scale an UIImageView.
When my slider value is 0 my UIImageView should have the original size (scaleX: 1, scaleY: 1).
When my slider value is 275 my UIImageView should scale to 0.85.
Can someone suggest a good formula to calculate the scale value in relationship with slider value?
Something like this
let scale = slider.value >= 275 ? 0.85 : 1
imageView.transform = CGAffineTransform(scaleX: scale, scaleY: scale)
But I have some trouble making the
scale dynamic based on slider value.