Your First iOS & SwiftUI App: An App from Scratch, Episode 4: SwiftUI Views | raywenderlich.com

Learn how to create user interfaces in SwiftUI by constructing a tree of Views, such as Text, Slider and Button.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/28797163-your-first-ios-swiftui-app-an-app-from-scratch/lessons/4

Suggest .previewInterfaceOrientation(.landscapeRight) rather than .previewLayout(.fixed(width:500, height: 320)) for changing the second content view to landscape.

1 Like

Completely agree! Except I did .previewInterfaceOrientation(.landscapeLeft) :wink:

Sometimes on IOS 16 Xcode 14 the 2 content views both stay portrait, then suddenly it works… is this a bug? I will change to what @danvw suggested to see how it works.

This worked great for me…