Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

.previewLayout(PreviewLayout.fixed(width:_,height:_)) not working in Xcode 14

Since updating to Xcode 14 the SwiftUI canvas is behaving differently.

I’m have files that are a fixed size and I am trying to preview them by adding

.previewLayout(PreviewLayout.fixed(width: width,height: height))

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

to the preview view.

Previously the behaviour was that I would see the canvas the expected width of view. Now I’m seeing the preview in a device.

Is there a way I can get this to work as expected again?

>Solution :

From Xcode 14 preview loads default in Live mode but you can change this to selectable, by clicking the second button from the bottom toolbar.

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading