@objc func popCartView(tapGestureRecognizer: UITapGestureRecognizer)
{
let modalViewController = CartViewController()
modalViewController.modalPresentationStyle = .overCurrentContext
self.present(modalViewController, animated: true, completion: nil)
}
如何用更多的时间(比如 2 秒来完成动画)为这个 View 设置动画
最佳答案
@objc func popCartView(tapGestureRecognizer: UITapGestureRecognizer)
{
let modalViewController = CartViewController()
modalViewController.modalPresentationStyle = .overCurrentContext
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
// Your code with delay
self.present(modalViewController, animated: true, completion: nil)
}
}
关于ios - 如何在 Modal View presentation swift iOS 中添加动画延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48861349/