2011-01-03 1 views

답변

7

animation.repeatCount = HUGE_VALF;을 시도해보십시오

영원히 반복 애니메이션을 발생합니다 HUGE_VALF이 속성을 설정.

39

또한이 정확히 HUGE_VALF과 동일

animation.repeatCount = INFINITY; 

사용할 수 있지만 그 자체로 말한다대로 나는 INFINITY를 선호합니다.

+3

Swift의 Float.infinity –

2

그냥 정의로 이동하십시오!
HUGE_VALF 또는 INFINITY 중 어떤 것이 든 상관 없습니다.
때문에 :

() math.c에 따라 (math.h : 마지막으로

#if defined(__GNUC__) 
# define HUGE_VAL  __builtin_huge_val() 
# define HUGE_VALF __builtin_huge_valf() 
# define HUGE_VALL __builtin_huge_vall() 
# define NAN   __builtin_nanf("0x7fc00000") 
#else 
# define HUGE_VAL  1e500 
# define HUGE_VALF 1e50f 
# define HUGE_VALL 1e5000L 
# define NAN   __nan() 
#endif 

#define INFINITY HUGE_VALF 

과 :

/* FUNCTION: __builtin_huge_valf */ 
inline float __builtin_huge_valf(void) { return 1.0f/0.0f; } 

그래서 각 옵션이 확인 될 것입니다 :

animation.repeatCount = INFINITY; 
animation.repeatCount = HUGE_VALF; 
animation.repeatCount = __builtin_huge_valf(); 
animation.repeatCount = 1.0f/0.0f; 
2

Swift에서 다음 코드를 사용하고 있습니다 :

let animation = CATransition() 
animation.repeatCount = Float.infinity