If you understand correctly, you want something like the following:

To make calculations easier, you need to play with anchorPoint CALayer . anchorPoint is where transformations are applied, and its effects are especially noticeable when cornering. We will make CALayer rotate around one of its points, and not the center (by default).
This is my loadView :
UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; view.backgroundColor = [UIColor whiteColor]; CGRect frame = CGRectMake(view.frame.size.width - 100.f, view.frame.size.height / 2.f - 50.f, 100.f, 100.f); UIView *red = [[UIView alloc] initWithFrame:frame]; red.backgroundColor = [UIColor redColor]; [view addSubview:red]; CATransform3D rotation = CATransform3DIdentity; rotation.m34 = -1.0/500.0;
And I get the image you see above.
Hope this helps!
source share