Skip to content

Instantly share code, notes, and snippets.

@ajjames
Created April 24, 2025 17:41
Show Gist options
  • Save ajjames/eaadd756836fb7d7a80184f9c9c55500 to your computer and use it in GitHub Desktop.
Save ajjames/eaadd756836fb7d7a80184f9c9c55500 to your computer and use it in GitHub Desktop.
Remove background from sheets
import SwiftUI
/// Usage:
/// .fullScreenOverlay(isPresented: $showAttachmentsMenu) {
/// SomeView()
/// .background(BackgroundClearView())
/// }
struct BackgroundClearView: UIViewRepresentable {
func makeUIView(context: Context) -> UIView {
let view = UIView()
DispatchQueue.main.async {
view.superview?.superview?.backgroundColor = .clear
}
return view
}
func updateUIView(_ uiView: UIView, context: Context) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment