Mat0
Mat0

Reputation: 1195

Blur image on UIScrollView swift?

I want to blur an image depending on how much a UIScrollView is scrolled. But the part I'm having trouble with is finding a method which can blur an image. I know the class UIVisualEffect but this doesn't seem to work because I can only adjust the opacity and not how much the image should blur at a giving scroll position. Does anyone know of a method which can be used for this or a lib?

I'm writing the school project in swift.

Upvotes: 1

Views: 919

Answers (1)

zuziaka
zuziaka

Reputation: 575

I don't think it's possible with UIKit. Using UIVisualEffect you are able to specify only blur type: .Light, .extraLight, .Dark. But if you want to specify blur radius you need use third party lib e.g: FXBlurView.

But mind that using FXBlurView is not as efficient as UIVisualEffect.

Edit: If you looking for Swift library, I found DynamicBlurView. But notice that you have to put your blurView above your imageView.

Upvotes: 1

Related Questions