Fran
Fran

Reputation: 25

How to implement SKActionTimingFunction?

How do you implement SKActionTimingFunction in objective-c?. I've looked everywhere and I just found an example in swift.

Thanks!

Upvotes: 1

Views: 541

Answers (2)

Geoff H
Geoff H

Reputation: 3247

In Swift 4.2:

moveAction.timingFunction = { time -> Float in
    return sin(time * .pi/2)
}

Upvotes: 0

hamobi
hamobi

Reputation: 8130

heres an example

moveAction.timingFunction = ^float(float t){
    return sin(t * M_PI/2);
};

man i hate blocks in objective-c

Upvotes: 5

Related Questions