Fernando Valente
Fernando Valente

Reputation: 1096

UIView perspective

I've got an UIView and I want to add perspective to it. Basically I got 4 other views that the user will drag in order to create the perspective. I'd like to indicate 4 points where the UIView's corners will be. I investigated it and I figured out I have to use CALayer to do that, but I'm still no clearer on how to create this kind of transform on an iPhone. Any help, pointers or example code snippets would be really appreciated!

Thanks!

Upvotes: 0

Views: 506

Answers (1)

Conrad Shultz
Conrad Shultz

Reputation: 8808

Start off by taking a look at the pertinent documentation for CATransform3D. You will create such a transform that describes your perspective and set the CALayer's -transform property to it. (Note that this is distinct from the UIView's -transform which is a CGAffineTransform, not a CATransform3D.)

Come back with code if you still encounter difficulties. :-)

Upvotes: 1

Related Questions