问题
How do you implement SKActionTimingFunction in objective-c?. I've looked everywhere and I just found an example in swift.
Thanks!
回答1:
heres an example
moveAction.timingFunction = ^float(float t){
return sin(t * M_PI/2);
};
man i hate blocks in objective-c
回答2:
In Swift 4.2:
moveAction.timingFunction = { time -> Float in
return sin(time * .pi/2)
}
来源:https://stackoverflow.com/questions/28520521/how-to-implement-skactiontimingfunction