Assuming you have a ContentView
defined and want to see it in the Swift playground preview with a landscape aspect ratio, this code snippet seems to work:
let view = UIHostingController(rootView: ContentView())
// pick whatever size you want (this is iPhone 8 div 2): view.preferredContentSize = CGSize(width: 667, height: 375) PlaygroundPage.current.liveView = view
Might be a better way, but when I didn’t find a menu item in Xcode 11.3 I just coded this in to move forward. Seems to work to check layout, though it’s not strictly “landscape orientation” from a device standpoint ¯\_(ツ)_/¯: