Including 'int' in 'CAMediaTimingFunction *' prohibited by ARC

Can anyone suggest an alternative to this line of code so that my code becomes ARC compatible.

[animation setTimingFunction:(CAMediaTimingFunction*)UIViewAnimationCurveEaseInOut]; 
+4
source share
1 answer

This code is incorrect even in MRR (not ARC). The only reason it doesn't crash is because UIViewAnimationCurveEaseInOut is set to 0 (which becomes nil after the translation).

You should use instead

 [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 

This will do what you intend to do, with the exception of the actual instance of CAMediaTimingFunction* .

+17
source

Source: https://habr.com/ru/post/1382011/


All Articles