# How to blur what is bellow a view not inside

**URL:** <https://forums.kodeco.com/t/how-to-blur-what-is-bellow-a-view-not-inside/31825>\
**Category:** Swift\
**Created:** [July 5, 2017, 4:39pm UTC](https://forums.kodeco.com/t/how-to-blur-what-is-bellow-a-view-not-inside/31825 "2017-07-05T16:39:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chr0x](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/chr0x/32/81494_2.png) [@chr0x](https://forums.kodeco.com/u/chr0x)\
**Post date:** [July 5, 2017, 4:39pm UTC](https://forums.kodeco.com/t/how-to-blur-what-is-bellow-a-view-not-inside/31825/1 "2017-07-05T16:39:49Z")

</div>

Hello guys ;

I’m wondering how can I create an effect similar to Apple Music view where is the track name:

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/a/8/a8f913a51783bfbaf036a5b28e60b0867b6c7e5d.jpg)

Here, when I scroll the main view, the content that pass below the track name view is blurred; I tried a lot of tutorials of blur effect in swift, but what they teach is to blur a view inside, not what I want. 😕

Any suggestions?

---

<div class="post-metadata">

**Author:** ![liamnichols](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/liamnichols/32/97664_2.png) [@liamnichols](https://forums.kodeco.com/u/liamnichols)\
**Post date:** [July 16, 2017, 10:04pm UTC](https://forums.kodeco.com/t/how-to-blur-what-is-bellow-a-view-not-inside/31825/2 "2017-07-16T22:04:14Z")

</div>

Hi @chr0x and welcome to the forums!

What you are looking for is `UIVisualEffectView`, it’s a simple `UIView` subclass that will blur any content underneath it. I put together the following implementation that you can paste into a playground to experiment with:

```
import UIKit
import PlaygroundSupport

let view = UIView(frame: CGRect(x: 0.0, y: 0.0, width: 200.0, height: 400.0))
view.backgroundColor = .lightGray

let scrollView = UIScrollView(frame: CGRect(x: 0.0, y: 0.0, width: 200.0, height: 400.0))
scrollView.contentSize = CGSize(width: 200.0, height: 700.0)
view.addSubview(scrollView)

let redView = UIView(frame: CGRect(x: 0.0, y: 300.0, width: 200.0, height: 400.0))
redView.backgroundColor = .red
scrollView.addSubview(redView)

let blurEffect = UIBlurEffect(style: .dark) // .light, .extraLight
let visualEffectView = UIVisualEffectView(effect: blurEffect)
visualEffectView.frame = CGRect(x: 0.0, y: 200.0, width: 200.0, height: 200.0)
view.addSubview(visualEffectView)

// scroll the top part to see the content move under the blur
PlaygroundPage.current.liveView = view

```

You can also check out this tutorial going a bit deeper into the API: [https://www.raywenderlich.com/84043/ios-8-visual-effects-tutorial](https://www.raywenderlich.com/84043/ios-8-visual-effects-tutorial)
