I have this code that should return the minimum value of two CGFloat
values:
var boundsSize:CGSize = scrollView.bounds.size
var imageSize:CGSize = imageView.bounds.size
var xScale:CGFloat = boundsSize.width / imageSize.width
var yScale:CGFloat = boundsSize.height / imageSize.height
var minScale:CGFloat = MIN(xScale, yScale) // this does not work
But MIN
does not seem to have an equivalent in swift. So how do I do this?