Xcode: Argument passed to call that takes no arguments

224 Views Asked by At

I'm currently working on an App where Meteors should spawn randomly as enemies. I have this code:

let randomXStart = random(min: CGSize, max: CGSize)
let randomXEnd = random(min: CGSize, max: CGSize)

Which returns:

Argument passed to call that takes no arguments

I'm currently using xcode 9.3.1.

Thanks for your help in advance!

1

There are 1 best solutions below

0
On

I assume you are writing Swift code. There is no random() method in Swift. If you want to create random numbers, you can reference the following.

How does one generate a random number in Apple's Swift language?