Thanks for the answer. I also found another solution. With yours, this is not a shadow (without a radius ...):
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.clear
let blurEffect = UIBlurEffect(style: .light)
let sideEffectView = UIVisualEffectView(effect: blurEffect)
sideEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
sideEffectView.frame = self.view.bounds
self.view.addSubview(sideEffectView)
let shadowView = UIView(frame: CGRect(x: 0.0, y: 0, width: self.view.bounds.size.width, height: self.view.bounds.size.height))
shadowView.translatesAutoresizingMaskIntoConstraints = false
shadowView.backgroundColor = UIColor.white
shadowView.layer.masksToBounds = false
shadowView.layer.shadowOffset = CGSize(width: 2.5, height: 2.5)
shadowView.layer.shadowOpacity = 1.0
shadowView.layer.shadowRadius = 2.5
self.view.insertSubview(shadowView, at: 0)
NSLayoutConstraint(item: shadowView, attribute: NSLayoutAttribute.trailing, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.trailingMargin, multiplier: 1.0, constant: 0.0).isActive = true
NSLayoutConstraint(item: shadowView, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.topMargin, multiplier: 1.0, constant: 0.0).isActive = true
NSLayoutConstraint(item: shadowView, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.bottomMargin, multiplier: 1.0, constant: 0.0).isActive = true
NSLayoutConstraint(item: shadowView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1.0, constant: 5.0).isActive = true
}

source
share