Hank Brekke
Hank Brekke

Reputation: 2024

CoreAnimation Class Error

I am trying to run the code from the answer at the UIView vertical flip animation question, and I keep getting this error in Xcode:

error: Semantic Issue: Assigning to 'CGAffineTransform' (aka 'struct CGAffineTransform') from incompatible type 'CATransform3D' (aka 'struct CATransform3D')

and I don't know how to fix it, and it doesn't seem like it should be happening based on what other people are saying about the code working and such.

The error is on the line of

myView.transform = CATransform3DMakeRotation(M_PI_2,1.0,0.0,0.0);

Upvotes: 5

Views: 4312

Answers (1)

Colin
Colin

Reputation: 3752

CATransform3DMakeRotation returns a CATransform3D. But, UIView.transform is a CGAffineTransform, which is not the same. You could try

myview.layer.transform = CATransform3DMakeRotation(...);

CALayer's transform is of type CATransform3D.

Upvotes: 14

Related Questions