I'm trying to understand how to create depth perceptive to my UIView
like this :
I've tried this code:
var rotationWithPerspective = CATransform3DIdentity;
rotationWithPerspective.m34 = -1.0/500.0/2/2
rotationWithPerspective = CATransform3DRotate(rotationWithPerspective, 22.5, 0, 1, 0);
preview.layer.transform = rotationWithPerspective
which generates perspective. Yet, it Flips the View for some reason.
1) How can I avoid the "flipping" after the transform?
2) Does the "perspective depth" resulting from the transform, will be the same to every given UIView
, or it depends on the UIView
size, etc?
Thank YOU!