Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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