Created
May 11, 2020 03:30
-
-
Save maakcode/4ea7f0693741f8f78eaf41d9e745a989 to your computer and use it in GitHub Desktop.
Visual Effects View in SwiftUI, AppKit
This file contains 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
// Visual Effects View in SwiftUI, AppKit | |
// cf. https://gist.github.com/edwurtle/98c33bc783eb4761c114fcdcaac8ac71#file-blur-swift | |
import SwiftUI | |
struct NSBlur: NSViewRepresentable { | |
var blendingMode: NSVisualEffectView.BlendingMode = .withinWindow | |
func makeNSView(context: Context) -> NSVisualEffectView { | |
let view = NSVisualEffectView() | |
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