Home > Software engineering >  How can I tell if an iPhone's home indicator is present or not in xcode?
How can I tell if an iPhone's home indicator is present or not in xcode?

Time:06-07

I have placed a button at the bottom of the safe area.

On iPhone X and later devices, it is placed well above a certain margin, but in the case of an iPhone with a home button, it is attached to the bottom.

So, I would like to set a separate constraint only on iPhones with a home button to leave a certain margin.

enter image description here

enter image description here

we see that both the blue button and the red view are bottom-constrained to the safe area.

When running on a phone with a physical button (iPhone 8, for example) it looks like this:

enter image description here

enter image description here

the red view is still constrained to the safe area, but the blue button keeps its minimum distance from the view bottom.

  • Related