Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluuur not working on iOS 14 #1

Open
Mallenow opened this issue Sep 23, 2020 · 4 comments
Open

Bluuur not working on iOS 14 #1

Mallenow opened this issue Sep 23, 2020 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Mallenow
Copy link

Hello,

first of all i want to thank you for the nice framework. But unfortunately it doesn't work properly on iOS 14. After I updated my device, the blur effect does not displayed anymore. The area is only displayed in grayscale.

Here are my functions:

    func blurThemAll(){
        let blurView = MLWBluuurView()
        let navBlur = MLWBluuurView()
        self.navigationController?.navigationBar.addSubviewWithoutAnimation(subview: navBlur)
        blurView.colorTintAlpha = 0
        blurView.colorTint = .BLACK_141B2C
        view.addSubviewWithoutAnimation(subview: blurView)
        
        UIView.animate(withDuration: 0.4) {
            navBlur.blurRadius = 8
            blurView.colorTintAlpha = 0.6
            blurView.blurRadius = 8
        }
    }
    
    func allBlurMustDie(){
        var blurView : MLWBluuurView?
        var navBlur : MLWBluuurView?
        
        self.view.subviews.forEach { view in
            if view.isKind(of: MLWBluuurView.self){
                blurView = view as? MLWBluuurView
            }
        }
        
        navigationController?.navigationBar.subviews.forEach({ view in
            if view.isKind(of: MLWBluuurView.self){
                navBlur = view as? MLWBluuurView
            }
        })

        UIView.animate(withDuration: 0.4, animations: {
            navBlur?.blurRadius = 0
            blurView?.colorTintAlpha = 0
            blurView?.blurRadius = 0
        }) { _ in
            blurView?.removeFromSuperview()
            navBlur?.removeFromSuperview()
        }
    }

I hope you can help me with this issue quickly.

Many thanks
Mallenow

@podkovyrin
Copy link
Contributor

Bluuur is built on top of the private class _UICustomBlurEffect which seems no longer works in iOS 14.

@podkovyrin podkovyrin added bug Something isn't working good first issue Good for newcomers labels Sep 23, 2020
@Mallenow
Copy link
Author

Will the framework be updated in the near future?

@danh-geo
Copy link

danh-geo commented Nov 5, 2020

@Mallenow I would give this a try: https://github.com/unboxme/Blurberry so far so good.

@podkovyrin
Copy link
Contributor

podkovyrin commented Nov 5, 2020

@danh-geo @Mallenow

https://github.com/unboxme/Blurberry

While this seems quite comprehensive I wouldn't use it in production because of the extensive use of private APIs (For the same reason, I wouldn't use Bluuur today). Recently I found out quite an elegant way to set the blur radius using vanilla UIKit:

    private let animator: UIViewPropertyAnimator

    override init(frame: CGRect) {
        let visualEffectView = UIVisualEffectView(effect: nil) // must be nil

        animator = UIViewPropertyAnimator(duration: 1, curve: .linear, animations: {
            visualEffectView.effect = UIBlurEffect(style: .regular)
        })

...

    // set the needed radius with a percentage:
    animator.fractionComplete = 0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants