Set the repeatCount
to Float.infinity
. This compiles and works.
In all probability, HUGE_VALF
was a legacy value in any case.
Still, it's a bit of a surprise that these numeric constant names are not seen by Swift. I did try importing <stdlib.h>
in the bridging header but it didn't help.
But please see now Martin R's answer. Since the time when I posted my answer, Apple has stated their preferred answer explicitly: use .greatestFiniteMagnitude
. It is almost the same thing as .infinity
but not quite!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…