efremidze / VisualEffectView

Dynamic blur background view with tint color (UIVisualEffectView subclass) 📱
MIT License
1.13k stars 80 forks source link

is not working in iOS 14 #25

Open MehmetDenizYalcin opened 4 years ago

MehmetDenizYalcin commented 4 years ago

it is working if you add this

func setValue( value: T, forKey key: Key) { blurEffect.setValue(value, forKeyPath: key.rawValue) if #available(iOS 14, *) { } else { self.effect = blurEffect } }

shkipan commented 3 years ago

Could you be more specific? I have the same issue, recompiling project in IOS14. The blur on view is missing, _UIVisualEffectBackdropView doesn't react on changes, applied to it

bachvanthe1994 commented 3 years ago

I have the same issue, But in my app, the blur has shown a black-white view. You can see image above image

MehmetDenizYalcin commented 3 years ago

@bachvanthe1994 yes if you add latest changes and change below code like this it will work

func setValue( value: T, forKey key: Key) { blurEffect.setValue(value, forKeyPath: key.rawValue) if #available(iOS 14, *) { } else { self.effect = blurEffect } }

@shkipan self.effect = blurEffect remove _UIVisualEffectSubview and you see black and white in iOS 14

shkipan commented 3 years ago

@MehmetDenizYalcin, solved, adding UIBlurEffect and removing last subview from subviews helped

bachvanthe1994 commented 3 years ago

@bachvanthe1994 yes if you add latest changes and change below code like this it will work

func setValue( value: T, forKey key: Key) { blurEffect.setValue(value, forKeyPath: key.rawValue) if #available(iOS 14, *) { } else { self.effect = blurEffect } }

@shkipan self.effect = blurEffect remove _UIVisualEffectSubview and you see black and white in iOS 14

Thank bro, that worked. But I hope the owner of the respository will commit a new release. I don't want to change the source in pod folder because it is not stability

nadimalam commented 3 years ago

Hey guys, was wondering if any of you could potentially help me please as ive been stuck on this issue for a while.

I cant seem the blur effect to work on iOS14 devices, it works fine on iOS13 though.

    let blurEffect = (NSClassFromString("_UICustomBlurEffect") as! UIBlurEffect.Type).init()
    blurEffect.setValue(8, forKeyPath: "blurRadius")
    blurView = UIVisualEffectView(effect: blurEffect)
    blurView.frame = UIScreen.main.bounds
    blurView.alpha = 1
    view.insertSubview(blurView, aboveSubview: imvBackground)

Is anyone please able to help me fix this? Thanks.

MehmetDenizYalcin commented 3 years ago

Hey guys, was wondering if any of you could potentially help me please as ive been stuck on this issue for a while.

I cant seem the blur effect to work on iOS14 devices, it works fine on iOS13 though.

    let blurEffect = (NSClassFromString("_UICustomBlurEffect") as! UIBlurEffect.Type).init()
    blurEffect.setValue(8, forKeyPath: "blurRadius")
    blurView = UIVisualEffectView(effect: blurEffect)
    blurView.frame = UIScreen.main.bounds
    blurView.alpha = 1
    view.insertSubview(blurView, aboveSubview: imvBackground)

Is anyone please able to help me fix this? Thanks.

Check my comment, it is the first one.

nadimalam commented 3 years ago

Hey guys, was wondering if any of you could potentially help me please as ive been stuck on this issue for a while. I cant seem the blur effect to work on iOS14 devices, it works fine on iOS13 though.

    let blurEffect = (NSClassFromString("_UICustomBlurEffect") as! UIBlurEffect.Type).init()
    blurEffect.setValue(8, forKeyPath: "blurRadius")
    blurView = UIVisualEffectView(effect: blurEffect)
    blurView.frame = UIScreen.main.bounds
    blurView.alpha = 1
    view.insertSubview(blurView, aboveSubview: imvBackground)

Is anyone please able to help me fix this? Thanks.

Check my comment, it is the first one.

Oh right, thank you, but please can you tell me where to add this setValue function?

UPDATE: I Should have mentioned that im not using this VisualEffectView Pod Library, instead im using just the default apple implementation