Pop up Animation with UIVisualEffects is disabling button underneath

I am trying to add a pop up with a blurred view behind it to hide the view controller content. However the button to access this pop up is positioned underneath the blur effect which is disabling the button.
Does anyone know how to fix this?
Heres my code:

import UIKit

class View2: UIViewController {

var effect:UIVisualEffect!

@IBOutlet weak var VisualEffectview: UIVisualEffectView!

@IBOutlet var VDview: UIView!

override func viewDidLoad() {
    super.viewDidLoad()
    effect=VisualEffectview.effect
    VisualEffectview.effect=nil
    VDview.layer.cornerRadius=5

    // Do any additional setup after loading the view.
}

func openBOX(){
    self.view.addSubview(VDview)
    VDview.center = self.view.center
    VDview.transform = CGAffineTransform.init(scaleX: 1.3, y: 1.3)
    VDview.alpha = 0
    UIView.animate(withDuration: 0.4){
        self.VisualEffectview.effect = self.effect
        self.VDview.alpha = 1
        self.VDview.transform = CGAffineTransform.identity
    }
}

func closeBOX(){
    UIView.animate(withDuration:0.3, animations: {
        self.VDview.transform = CGAffineTransform.init(scaleX: 1.3, y: 1.3)
        self.VDview.alpha = 0
        self.VisualEffectview.effect = nil
    }) { (success:Bool) in
            self.VDview.removeFromSuperview()
    }
}


@IBAction func VDDopen(_ sender: UIButton) {
    openBOX()
}

@IBAction func VDclose(_ sender: UIButton) {
    closeBOX()
}





override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()

}

  • Perform a task (in iOS) after animation has finished
  • Playing prepared animation in iOS
  • Animating an image view to slide upwards
  • Can't animate the frame or bounds of a UISearchBar
  • iPhone view move animation
  • How to cancel UIView block-based animation?