Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone X hide home indicator on view controller

I have a view controller that takes up the whole screen from top to bottom. I would like to hide the home bar indicator on the bottom of the screen on iPhone X devices.

How can I do this in iOS 11?

like image 485
Vlad Avatar asked Oct 11 '17 15:10

Vlad


People also ask

How do I hide the Home icon on my iPhone X?

You simply need to tap Start (or Resume, if you've triple-clicked a second time) to enter Guided Access mode, in which the Home bar is disabled.

How do I hide the home bar?

Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.

How do I hide the control bar on my iPhone?

Launch the Settings app on your ‌iPhone‌ or ‌iPad‌. Tap Face ID (or Touch ID) and Passcode. Enter your passcode if prompted. Scroll down and turn off the switch next to Control Center.


1 Answers

You should override prefersHomeIndicatorAutoHidden in your view controller to achieve that:

override var prefersHomeIndicatorAutoHidden: Bool {     return true } 
like image 84
Tamás Sengel Avatar answered Sep 19 '22 05:09

Tamás Sengel