can you change the Xcode swiftui preview defaults?

Viewed 173

The best thing about Xcode is the canvas and previews - it's pretty good. However, I disagree with most of the defaults, which means I need to hang a bunch of stuff off each view

For instance - I think

.previewLayout(.sizeThatFits)

is a much better default [because lets be honest, showing the device around the preview adds no value to anyone ]

and because I never ever ever under any circumstances want the preview to be shipped out to my real physical device, I always find myself adding:

.previewDevice("iPhone 12 Pro Max")

I know I could have an extension method like "standard" and add ".standard" to every view - but that still means I need to remember to do something.

Is there anyway to just say "this is my default setting for previewDevice for the entire project"?

0 Answers
Related