Post

Replies

Boosts

Views

Activity

Reply to Transparent window in SwiftUI macOS application
Repost with corrections. Try something like this: struct VisualEffect: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return NSVisualEffectView() }    func updateNSView(_ nsView: NSView, context: Context) { } } .background(VisualEffect()) For pure transparent try something like class TransparentWindowView: NSView {   override func viewDidMoveToWindow() {     window?.backgroundColor = .clear     super.viewDidMoveToWindow()   } } struct TransparentWindow: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return TransparentWindowView() }    func updateNSView(_ nsView: NSView, context: Context) { } } .background(TransparentWindow())
Nov ’21
Reply to Transparent window in SwiftUI macOS application
Try something like this: struct VisualEffect: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return NSVisualEffectView() } } .background(VisualEffect) For pure transparent try something like class TransparentWindowView: NSView {   override func viewDidMoveToWindow() {     window?.backgroundColor = .clear     super.viewDidMoveToWindow()   } } struct TransparentWIndow: NSViewRepresentable    func makeNSView(context: Self.Context) -> NSView { return TransparentWindowView() } .background(TransparentWIndow)
Nov ’21
Reply to How does one access a file inside of a XCTestCase class?
Try using a custom working directory set to $(PROJECT_DIR) in the scheme run options. If your tests don't use the run action's arguments and environment variables then you can still manually set the working directory by editing the scheme using a text editor (close Xcode first). eg project.xcodeproj/xcshareddata/xcschemes/tests.xcscheme <LaunchAction buildConfiguration = "Debug" useCustomWorkingDirectory = "YES" customWorkingDirectory = "$(PROJECT_DIR)"
Nov ’21