I want to keep a view always at the front. In Swift CGFLOAT_MAX
and FLT_MAX
are replaced with corresponding .greatestFiniteMagnitude
. So, I used:
view.layer.zPosition = .greatestFiniteMagnitude
It works fine, but now I get a warning:
CoreAnimation: zPosition should be within (-FLT_MAX, FLT_MAX) range.
Is there a way to get rid of the warning (maybe a better value to use here)?
Thanks.
On a 64-bit platform
Apparently the
zPosition
should be in the (smaller) range of aFloat
: