Conclusion
Building views that work on multiple device sizes isn’t easy. Luckily, SwiftUI has a bunch of APIs to help developers achieve whatever type of UI they can imagine, while still supporting accessibility and the many devices of the Apple ecosystem.
AnyLayout and ViewThatFits are two great SwiftUI views that help take the load off of developers so they can focus on building amazing features while SwiftUI takes care of the rest.
In this lesson, you learned:
- About
AnyLayoutand how it can change the arrangement of its subviews without destroying and recreating them. - About the new
Layoutprotocol and how you can use it to build complex container layouts. - How to use
ViewThatFitsto allow it to choose for you the best view for the available space.
In the next module, you’ll learn about SwiftUI Navigation and how navigation behaves in a SwiftUI app. You’ll also learn the diverse navigation patterns available to iOS developers.