Home > Net >  How exactly do I have to use the perspective transform on CALayer?
How exactly do I have to use the perspective transform on CALayer?

Time:07-06

I'm attempting to add perspective to a view in UIKit.

Currently my implementation looks like this:

let view: UIView

...

vat perspective = CATransform3DIdentity

view.layer.sublayerTransform = perspective

view.layer.transform = CATransform3DConcat(
    perspective,
    someTransform
)


Now enter image description here

enter image description here

enter image description here

enter image description here

Play around with that example code to get a better idea of what's going on.

  • Related