@objc func popCartView(tapGestureRecognizer: UITapGestureRecognizer)
{
let modalViewController = CartViewController()
modalViewController.modalPresentationStyle = .overCurrentContext
self.present(modalViewController, animated: true, completion: nil)
}
如何使用更长的时间(例如2秒完成动画)为此视图设置动画
答案 0 :(得分:0)
@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)
}
}