以下代码适用于我可以访问的所有设备模拟器。但是,一些用户报告了导致我认为在某些情况下没有调用完成块的问题。我现在不知道。有什么建议吗?
CATransaction.begin()
CATransaction.setCompletionBlock {
self.performSegue(withIdentifier: "ContractViewController", sender: sender.companyJob)
}
self.navigationController?.popViewController(animated: true)
CATransaction.commit()
顺便说一句,我想要实现的是弹出和推送屏幕过渡动画。在这一点上,我愿意接受任何解决方案或解决方法。提前致谢。
来自doc的额外文件:
/* Accessors for the "completionBlock" per-thread transaction property. * Once set to a non-nil value the block is guaranteed to be called (on * the main thread) as soon as all animations subsequently added by * this transaction group have completed (or been removed). If no * animations are added before the current transaction group is * committed (or the completion block is set to a different value), the * block will be invoked immediately. Added in Mac OS X 10.6. */