Does SwiftUI for macOS have an equivalent of NSVisualEffectView's blendingMode?

NSVisualEffectView in AppKit has two main properties: material and blendingMode.

Material is well supported in SwiftUI, but I can't seem to find an equivalent for blendingMode.

What is the SwiftUI equivalent to NSVisualEffect.BlendingMode?

Answered by Frameworks Engineer in 865089022

Hi kennyc,

This one's a little subtle: generally Material operates similar to NSVisualEffectView's .withinWindow mode, but it'll use .behindWindow semantics if it's used as a container background. For example:

.containerBackground(.thinMaterial, for: .window)

produces a material fill which pulls in content from anything behind your window.

Accepted Answer

Hi kennyc,

This one's a little subtle: generally Material operates similar to NSVisualEffectView's .withinWindow mode, but it'll use .behindWindow semantics if it's used as a container background. For example:

.containerBackground(.thinMaterial, for: .window)

produces a material fill which pulls in content from anything behind your window.

Does SwiftUI for macOS have an equivalent of NSVisualEffectView's blendingMode?
 
 
Q