1

In macOS (not iOS) I am trying to get a page-turn effect to transition between two images. So far I have this:

    // given NSImageView named imageView

    let animation = CABasicAnimation(keyPath: "transform")
    let startingPoint = imageView.layer?.transform
    var temp = startingPoint
    /* m11 horiz, m22 vertical*/
    temp?.m11 = 0.0
    let endingPoint = temp
    animation.fromValue = startingPoint
    animation.toValue = endingPoint
    animation.repeatCount = 2
    animation.duration = 2.0
    imageView.layer?.add(animation, forKey: "linearMovement")

The animation rotates the view okay, but there is no 3D effect to really emphasize the page turn. How do I get the image 'page edge' to appear to come towards the user?

HenryRootTwo
  • 2,572
  • 1
  • 27
  • 27

0 Answers0