0

I have to figure out a way to hide the home button for all of my View controllers in the app.

Yes

override var prefersHomeIndicatorAutoHidden: Bool {
        return true
    }

is an option but what if I have like 100 VCs, is this the only way? I use navigation controller so I tried to override this property there, but it doesn't seems to have a reflection on the others as well. Any ideas? Thanks in advance.

  • 2
    you can create a default base view controller class and all your VCs will be subclasses of it. in this base class you can control the `prefersHomeIndicatorAutoHidden ` – Andrey Gershengoren Jun 10 '19 at 10:53
  • Ofc... That is so simple.. Thanks man, I would've bounced my head all day long .. Guess my Java background didn't help much, thanks again! – Ivan Mirchev Jun 10 '19 at 10:57
  • here is a solution using extension that will override all VC in your case https://stackoverflow.com/a/46776347/1806270 – Pancho Jun 10 '19 at 11:31

0 Answers0