I am making an application where I need to transform images, and images can be placed anywhere in the view. But the problem I am facing when I am doing perspective transformation using below code
CATransform3D rotationAndPerspectiveTransform = self.layer.transform;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, 22.5f * M_PI / 180.0f, 0, 1, 0.0f);
self.layer.transform = rotationAndPerspectiveTransform;
It works perfectly, but when I try to place a 2D image over the "perspective transformed" image(3D), the 2D image intersects the 3D image. It doesn't appear above the 3D image.
Why is this happening?