Created
January 28, 2025 09:33
-
-
Save Erica-Iris/bdc8e1d8e1244d3ae5e33a8699f786ee to your computer and use it in GitHub Desktop.
VisualEffectView
This file contains hidden or 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 SwiftUI | |
struct VisualEffectView: NSViewRepresentable { | |
let material: NSVisualEffectView.Material | |
let blendingMode: NSVisualEffectView.BlendingMode | |
func makeNSView(context _: Context) -> NSVisualEffectView { | |
let visualEffectView = NSVisualEffectView() | |
visualEffectView.material = material | |
visualEffectView.blendingMode = blendingMode | |
visualEffectView.state = .active | |
visualEffectView.isEmphasized = true | |
return visualEffectView | |
} | |
func updateNSView(_: NSVisualEffectView, context _: Context) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment