SwiftUI Previews

These are notes I’ve taken while watching the video of the corresponding session. They don’t have all the information contained in the video, but I’ve tried to still write the main points for my personal use cases.

Press play to start a preview.

You can customize your preview with data:

#if DEBUG struct Controller_Previews: PreviewProvider { static var previews: some View { SwiftUIView(model: MyModel()) } } #endif

You can also have multiple views to preview:

xx

And even change the environment we’re previewing our app in:

xx

Image

Valentino Urbano

iOS Developer, Swift, Writer, Husband

Back to Overview