【发布时间】:2020-06-10 17:43:33
【问题描述】:
我找到了一个不错的 curl 视图动画,我想在完成后添加 segue,但 segue 是先调用的(即使返回 viewcontroller 我也可以看到动画结束)。请帮我找出错误或实现目标的方法
UIView.animate(withDuration: 1, animations: {
let animation = CATransition()
animation.duration = 1
animation.startProgress = 0.0
animation.endProgress = 1
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
animation.type = CATransitionType(rawValue: "pageCurl")
animation.subtype = CATransitionSubtype(rawValue: "fromRight")
animation.isRemovedOnCompletion = false
animation.isRemovedOnCompletion = false
self.selectedCell!.view1.layer.add(animation, forKey: "pageFlipAnimation")
}, completion: { _ in
let secondViewController = self.storyboard?.instantiateViewController(withIdentifier: "PageVC") as? PageVC
secondViewController!.modalPresentationStyle = .fullScreen
self.navigationController?.present(secondViewController!, animated: false, completion: nil)
})
【问题讨论】:
标签: ios swift core-animation uiviewanimation