Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created June 24, 2026 10:13
Show Gist options
  • Select an option

  • Save jacobsapps/7ee3ad4e9067c3c1367e5acc22422690 to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/7ee3ad4e9067c3c1367e5acc22422690 to your computer and use it in GitHub Desktop.
ProgressiveBlurView from My top 3 design “Kisses” I like to add to every app
override func layoutSubviews() {
super.layoutSubviews()
let filter = (NSClassFromString("CAFilter") as! NSObject.Type)
.perform(NSSelectorFromString("filterWithType:"), with: "variableBlur")!
.takeUnretainedValue() as! NSObject
filter.setValue(20, forKey: "inputRadius")
filter.setValue(makeMaskImage(), forKey: "inputMaskImage")
filter.setValue(true, forKey: "inputNormalizeEdges")
subviews.first?.layer.filters = [filter]
let featherMask = CAGradientLayer()
featherMask.frame = bounds
featherMask.colors = [
UIColor.black.cgColor,
UIColor.black.cgColor,
UIColor.clear.cgColor,
]
featherMask.locations = [0, 0.55, 1]
layer.mask = featherMask
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment