How to add vibrancy effect to an image

350 Views Asked by At

I made a blur image using UIBlureffect and it worked fine. I would like to add a vibrancy image but so far it has not worked

Current code:

@IBOutlet var imageViewGif: UIImageView!

func addEffect()
{
    var effect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
    var effectView = UIVisualEffectView(effect: effect)
    effectView.frame = CGRectMake(0, 0, 400, 536)
    view.addSubview(effectView)
}

I would like to add an image that is not restricted to a preset area, and I would like the blur effect to adapt to the image area if possible (the image is not square).

If there is anything more you need, do not hesitate to ask!

1

There are 1 best solutions below

0
Nathannn On

I solved this using the hierachy view and added the "visual effect with blur and vibrancy effect" from the object library.