cannot call * using an argument list of type ($ T12, @lvalue CGFloat)
Read the answer by mistake:
mainView.frame.size.width is of type CGFloat , so you need to add CGFloat to Float
Try setting value as CGFloat or pour Float(image.size.width)
In the playground
Option 1
let image = UIImage(named:"group_1.png") // just for example let value:CGFloat = 10.0 let width:Float = Float(image.size.width / 100.0 * value)
Option 2
let value:Float = 10.0 let width:Float = Float(image.size.width) / 100.0 * value
Maxim shoustin
source share