iOS 27 automatic resize

With iOS 27's automatic resizability for iPhone apps on iPad and in iPhone Mirroring, what's the recommended pattern for views that need genuinely different layouts at different size classes — is ViewThatFits the intended tool, or should we still branch on size class for larger structural changes? — Divya Ravi, Senior iOS Engineer

Answered by Frameworks Engineer in 892552022

For layouts that are more complex, your app has a few options based on what is changing

In general, I would try to avoid branching on size class based on size class changing - a root-level if statement based on size class will tear down the state and views in the other branches which can result in churn. When resizing, the content shouldn’t be dramatically changing, but instead adapting to the different size.

  • I’d consider if using an adaptive system container like a split view would be an option. That will do most of the work of handling the size class transitions for you.
  • Using a different layout can be a powerful tool for maintaining the same views/state, but adapting them based on the available size. You can use an AnyLayout to change between the standard or custom layouts, or write your own custom layout. I’m a fan of this WWDC talk for learning more about custom layouts
  • ViewThatFits is a higher level tool for picking a view based on sizes. If you use that, make sure to lift out state that’s shared between branches (like selection values), since a user might be in the middle of an action and will expect things to stay the same when they resize

For layouts that are more complex, your app has a few options based on what is changing

In general, I would try to avoid branching on size class based on size class changing - a root-level if statement based on size class will tear down the state and views in the other branches which can result in churn. When resizing, the content shouldn’t be dramatically changing, but instead adapting to the different size.

  • I’d consider if using an adaptive system container like a split view would be an option. That will do most of the work of handling the size class transitions for you.
  • Using a different layout can be a powerful tool for maintaining the same views/state, but adapting them based on the available size. You can use an AnyLayout to change between the standard or custom layouts, or write your own custom layout. I’m a fan of this WWDC talk for learning more about custom layouts
  • ViewThatFits is a higher level tool for picking a view based on sizes. If you use that, make sure to lift out state that’s shared between branches (like selection values), since a user might be in the middle of an action and will expect things to stay the same when they resize

Is there a way to disable iOS 27's automatic resizability until an app is completely ready for it? For now, the app works only on iPhone. (I have a future plan to add support for iPad.)

iOS 27 automatic resize
 
 
Q