1
@objc func popCartView(tapGestureRecognizer: UITapGestureRecognizer)
{
    let modalViewController = CartViewController()
    modalViewController.modalPresentationStyle = .overCurrentContext
    self.present(modalViewController, animated: true, completion: nil)
}

How to animate this view with more time like 2 seconds to complete animation

Arasuvel
  • 2,971
  • 1
  • 25
  • 40
Farhan
  • 13
  • 2
  • 1
    Possible duplicate of [How to program a delay in Swift 3](https://stackoverflow.com/questions/38031137/how-to-program-a-delay-in-swift-3) – Prashant Tukadiya Feb 19 '18 at 07:35

1 Answers1

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)
    }
}
Sharad Paghadal
  • 2,089
  • 15
  • 29