macOS的CATransition 动画和iOS中的CATransition动画的用法也是差不多的。比如一个跳转的转场动画是这样的
let qrCodeVC = QRCodeVC.init(nibName:"QRCodeVC", bundle:nil)
let transition = CATransition.init()
transition.isRemovedOnCompletion = true
transition.type = .push
transition.subtype = .fromLeft
transition.repeatCount = 1
transition.startProgress = 0.0
transition.endProgress = 1.0
transition.duration = 10.0
qrCodeVC.view.layer?.add(transition, forKey: nil)
self.presentAsModalWindow(qrCodeVC)
这样一个动画就完成了。