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
Post a Comment