How the iPhone X home button works

As soon as I saw iPhone X home indicator replacing the physical button, I got interested in its behavior: it has to be visible both on the lock screen with an arbitrary wallpaper as a background and in any 3rd-party app showing arbitrary content, which in case of videos or games can also change quite quickly.

Obviously, UIKit doesn’t expose anything remotely similar, so let’s figure out how it is built!

Cool look at how the home indicator on the iPhone X works.