Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove background color for SwiftUI HostingVC #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thisIsTheFoxe
Copy link

Make sure hosting VC doesn't have a background color.
Still supports .background from the content view, but if no background is set, make sure it's transparent.
If the background is NOT set, the UIHostingController adds the default bg color for the current color scheme / appearance.

Example
struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, World!")
                .screenshotProtected(isProtected: true)
        }
        .padding()
        .background(Color.red)
    }
}

IMG_D50E121FE37E-1

Make sure hosting VC doesn't have a background color
Still supports `.background` from the `content` view, but if no background is set, make sure it's transparent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant