Is it necessary to replace GeometryReader and containerRelativeFrame in preparation for iPhone Duo support? If so, could you let me know the best way to do it.
Hi @icoriha,
It is not necessary to completely replace GeometryReader or containerRelativeFrame(_:alignment:) in preparation for iPhone Duo support. These layout tools remain fully supported and useful for building resizable interfaces on all platforms and form factors. However, iPhone Duo introduces new multi-display behaviors, folding poses, and hardware constraints like the inner fold and cameras, which you can manage using specialized APIs.
When designing layouts for devices with varying screen configurations like iPhone Duo, prefer sizing views relative to their container rather than fixed dimensions. The containerRelativeFrame(_:alignment:) modifier helps elements automatically adjust when an app resizes across inner and outer displays.
To handle hardware occlusions and the folding hinge on iPhone Duo, you can read reserved regions using a GeometryReader. Follow these steps to adapt your layout:
- Use a
GeometryReaderto access aGeometryProxyinstance. - Call
reservedRegions(kind:options:layoutDirectionBehavior:)to retrieve an array ofReservedRegionstructures. - Inspect active
.divisionsor.occlusions, such as camera cutouts or the hinge fold, and position your content accordingly.
For more information, see the post below:
How to know when active regions are changing?
https://developer.apple.com/forums/thread/847876?answerId=906445022#906445022
For advanced multi-display and folding adaptations introduced in iOS 27.1, consider adopting framework-provided containers like ArrangementView. This view container manages primary and secondary layouts gracefully in split or overlay arrangements depending on device pose.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer