Join us for Ask Apple, a new series for developers to connect directly with Apple experts. Ask about integrating the latest technologies into your apps, designing intuitive UIs, testing on the latest software, and so much more.
In iOS 16, Apple introduces a new view called AnyLayout. You can use it to switch layout dynamically. Say, switching between HStack and VStack based on the device's orientation.
If you call SwiftUI’s task modifier inside a view’s body property, the async operation will run on the main actor. However, this isn’t the case if you call task from a helper property or function that isn’t main-actor-annotated. Why?