Skip to main content

How to hide the home indicator and other system UI

About 2 minSwiftSwiftUIArticle(s)bloghackingwithswift.comcrashcourseswiftswiftuixcodeappstore

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)

Download this as an Xcode projectopen in new window

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

이찬희 (MarkiiimarK)
Never Stop Learning.