Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Jacob-Tate/5fbd3291662a7ec36199e405ea3090a9 to your computer and use it in GitHub Desktop.
Save Jacob-Tate/5fbd3291662a7ec36199e405ea3090a9 to your computer and use it in GitHub Desktop.
There are a few methods listed here I personally use ZStack
// Using ZStack
var body: some View{
ZStack {
Color.blue.ignoreSafeArea()
// Other content goes here
// NOTE: The other content will respect the safe area
}
}
// Using Overlay Modifiers
var body: some View{
Color.blue.ignoreSafeArea(.vertical) // Ignore just for the color
.overlay(
VStack(spacing: 20) {
Text("Overlay").font(.largeTitle)
Text("Example").font(.title).foregroundColor(.white)
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment