Im building a macOS application where the UI is a blurry transparent background that is somewhat see through like what apple uses for the macOS control center and I'm using the NSVisualEffectView from AppKit to do so. My question is, does the Xcode simulator accurately portray translucent UI views? in other words: "what you see is what you get" or will the vibrancy be more pronounced when the app is run on my machine itself.
var material: NSVisualEffectView.Material = .contentBackground //blurry background to cover the whole UI
var blendUI: NSVisualEffectView.BlendingMode = .behindWindow // applying the blurry background to the UI window itself
var allowsVibrancy: Bool = true
func makeNSView(context: Context) -> NSVisualEffectView {
let blurryEffectView = NSVisualEffectView()
blurryEffectView.material = material
blurryEffectView.blendingMode = blendUI
return NSVisualEffectView()
}
func updateNSView(_ nsView: NSVisualEffectView, context: Context) { // _ added, no argument label needed
nsView.material = .contentBackground
nsView.blendingMode = blendUI
}
}
struct ContentView: View {
var body: some View {
ZStack{
EffectView(material: NSVisualEffectView.Material.contentBackground, blendUI: NSVisualEffectView.BlendingMode.behindWindow )
}
}
}