2015-12-21 1 views
-4

Je souhaite initialiser la durée d'un CATransition avec un NSNumber, comment faire, puisque le animation.duration est un objet NSTimeInterval?Initialiser la durée CATransition avec le numéro NS

- (void)startPopUpAnimation:(NSNumber *)numbers { 

    CATransition *animation = [CATransition animation]; 
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 
    animation.type = kCATransitionFade; 
    animation.duration = @"2.15";//[NSNumber numberWithDouble:[numbers doubleValue]]; 

} 

Répondre

0

Ce fut plus facile que je pensais:

animation.duration est un typedef double donc je viens de le faire: animation.duration = [numbers doubleValue];