Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening door effect using Core Animation

I'm trying to create a transition/animation on a UIView that looks something like the image in the link below. It would start with a UIView that is a standard rectangle shape, the view would then animate/transition like the left side is being pushed and it rotates on the right side corner, like a door opening slightly. I'm sure this is a really easy thing to do in Core Animation, and I've tried searching for solutions, but haven't found any examples.

Here's an example of what I am trying to achieve:

enter image description here

like image 635
Thad Avatar asked Oct 11 '22 13:10

Thad


1 Answers

What you're hoping to achieve is fairly straight-forward if you aren't worried about adding any shading or lighting to the door.

Check out this post from this forum: How do I apply a perspective transform to a UIView?

It should point you in the right direction. You'll have to play around with the actual position of the door (ie making the perspective believable) but the code here should give you a good idea of how to transform the UIView (a CALayer really).

Good luck, James

like image 85
James Avatar answered Oct 30 '22 06:10

James