missing parameter #2 in call error in CGRectIntersectsRect

104 Views Asked by At

I am writing a small game in swift, in which a boat has to go around obstacles. However, I keep getting this "missing argument for parameter #2 in call" error in CGRectInersectsRect. I have checked how to call it in the directory, and am calling it correctly. What is the issue with my code?. Here it is:

 if (CGRectIntersectsRect(boat: CGRect, obstacleImageView: CGRect)) {
        endGame()
    }
}
1

There are 1 best solutions below

1
On

if (CGRectIntersectsRect(boat.frame, obstacleImageView.frame)) { endGame() } }

CGRect is a type of the parameter. It shouldn't be used when calling the function.