How to hide the home indicator and other system UI
About 2 min
How to hide the home indicator and other system UI êŽë š
SwiftUI by Example
Back to Home
How to hide the home indicator and other system UI | SwiftUI by Example
How to hide the home indicator and other system UI
Updated for Xcode 15
New in iOS 16
SwiftUI's persistentSystemOverlays()
modifier lets us show or hide the so-called ânon-transient system viewsâ that are automatically placed over our UI â Apple's name for the home indicator, the multitask indicator on iPad, and more.
For example, this will request to hide the overlays:
Text("This needs to take up lots of space")
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.yellow)
.persistentSystemOverlays(.hidden)
Note
This is a request to hide the overlays â it's down to the system to decide what it actually do.
Similar solutionsâŠ
How to hide the tab bar, navigation bar, or other toolbars | SwiftUI by Example
How to hide the tab bar, navigation bar, or other toolbars
How to stop system gestures from interfering with your own | SwiftUI by Example
How to stop system gestures from interfering with your own
How to show different images and other views in light or dark mode | SwiftUI by Example
How to show different images and other views in light or dark mode
How to let users share content using the system share sheet | SwiftUI by Example
How to let users share content using the system share sheet
How to layer views on top of each other using ZStack | SwiftUI by Example
How to layer views on top of each other using ZStack