Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Created June 21, 2022 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/9303041de55d1b388fb19cfb6b606237 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/9303041de55d1b388fb19cfb6b606237 to your computer and use it in GitHub Desktop.
struct VisualEffectView: NSViewRepresentable {
let material: NSVisualEffectView.Material
let blendingMode: NSVisualEffectView.BlendingMode
init(material: NSVisualEffectView.Material, blendingMode: NSVisualEffectView.BlendingMode = .withinWindow) {
self.material = material
self.blendingMode = blendingMode
}
func makeNSView(context: Context) -> NSVisualEffectView {
let view = NSVisualEffectView()
view.material = material
view.blendingMode = blendingMode
return view
}
func updateNSView(_ nsView: NSVisualEffectView, context: Context) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment