PreviewLayout
A size constraint for a preview.
Declaration
enum PreviewLayoutOverview
Customize the layout of a preview that you define using the PreviewProvider protocol by providing one of the preview layout values to the previewLayout(_:) view modifier. For example, you can tell the preview to take up only the amount of space that the view requires with PreviewLayout.sizeThatFits:
struct CircleImage_Previews: PreviewProvider {
static var previews: some View {
CircleImage()
.previewLayout(.sizeThatFits)
}
}