I'm trying to cut an image into 9 pieces in Swift. I'm getting this error:
'CGFloat' is not convertible to 'Double'
I get this error when I put i
or j
in the two variables.
Below is part of the code used for cutting the image.
for i in 1...3
{
for j in 1...3
{
var intWidth = ( i * (sizeOfImage.width/3.0))
var fltHeight = ( j * (sizeOfImage.height/3.0))
var portion = CGRectMake(intWidth,fltHeight, sizeOfImage.width/3.0, sizeOfImage.height/3.0);
.
.
"Code goes on"
What is the problem?