When my keyboard is showing, text inputs in stack view go up. Now I want to add a blur view behind this stack view.
App has been started:

I tried:
let blurEffect = UIBlurEffect(style: .prominent)
blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = view.bounds
view.addSubview(blurEffectView)
Now text input has been clicked:

My text input blurred

Your current code is adding a
UIVisualEffectViewon top of everything in your view controller's view hierarchy. If you want to blur everything but your text view, you'll need to reorganize your view hierarchy so your text view is a top-level subview of the view you want to blur.Then you'd add your
UIVisualEffectViewunder the text view by callinginsertSubview(_:belowSubview siblingSubview:)on the text view's parent view, and passing the text view as thesiblingSubview.That way the
UIVisualEffectViewwill cover up all the other subviews of the text view's parent view, but leave the text view unburied.Right now, though, your text view is enclosed in 2 different stack views, so you don't have a parent view that will contain all the other contents you want to hide.
If you want to blur the entire stack view that contains your text fields, call
insertSubview(_:belowSubview siblingSubview:)on the parent view of your text input stack view, and pass the text input stack view as thesiblingSubview.