Last active
July 15, 2020 14:26
-
-
Save stleamist/8ad6e3793d061ca206872eca56b28f00 to your computer and use it in GitHub Desktop.
UIBlurEffect with custom blur radius
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIBlurEffect { | |
@available(iOS 9.0, *) | |
static func customBlurEffect(blurRadius: CGFloat) -> UIBlurEffect { | |
let UICustomBlurEffect = NSClassFromString("_UICustomBlurEffect") as! UIBlurEffect.Type | |
let customBlurEffect = UICustomBlurEffect.init() | |
customBlurEffect.setValue(blurRadius, forKey: "blurRadius") | |
return customBlurEffect | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This no longer works in iOS 14. Private api usage at it's best :-(