iOS Swift max(), min() -



iOS Swift max(), min() -

in swift, trying utilize max() , min() functions.

max<t : comparable>(x: t, y: t, rest: t...) -> t min<t : comparable>(x: t, y: t, rest: t...) -> t

i trying utilize max() function in way:

var paddlex: int = int(paddle.position.x) + int(location.x - previouslocation.x) max(paddlex, paddle.frame.x/2, nil)

but getting error:

cannot convert expression's type of '()' type 'niltype'

is nil causing problem? rest: t... supposed be?

don't pass @ there. it's variadic function, can phone call 2 or more parameters.

ios swift

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -