Use the Insets unpack patch to unpack a device's inset values and output them as numbers relative to the edge of the screen.
This patch is useful for discovering a device’s safe area — the rectangle, inset from the edges of a screen, where the user is guaranteed to be able to interact with your effect.
Name | Description |
---|---|
Insets | An object containing insets information |
Name | Description |
---|---|
Top | A number that represents the top inset. |
Left | A number that represents the left inset. |
Bottom | A number that represents the bottom inset. |
Right | A number that represents the right inset. |
In the example below we used the Insets Unpack patch to unpack the Safe Area Insets of a device screen.
First we set the device in the Simulator to iPhone8, then we connected:
The Safe Area Insets output of the Device Producer Patch to the Insets input on the Insets Unpack patch.
The Top, Left, Bottom and Right values to the input of 4 Value patches.
The graph shows that the safe are of the iPhone8 is: