dmitrynikolaev
dmitrynikolaev

Reputation: 9132

Core Animation on Layer-Backed View with rotation

Just want to rotate NSView (without animation). Layer backed-view (setWantsLayer=YES). Works with opacity, position. But when I try rotate with

[view.layer setValue:[NSNumber numberWithInt:45*M_PI/180] forKeyPath:@"transform.rotation.y"];

Nothings happened.

Upvotes: 0

Views: 337

Answers (1)

David Rönnqvist
David Rönnqvist

Reputation: 56625

You are rotating 0 degrees.

45 * π / 180 = 0.785 which as an int is 0.

Change your NSNumber to a float or double

[NSNumber numberWithFloat:45*M_PI/180]

Upvotes: 1

Related Questions