One Logo Pool Ball
DeveloperToolsSupport · IOS API REFERENCE

PreviewLayout

enum · iOS 13.0+ · SDK 27.1

enum PreviewLayout

A size constraint for a preview. Customize the layout of a preview that you define using the <doc://com.apple.documentation/documentation/SwiftUI/PreviewProvider> protocol by providing one of the preview layout values to the <doc://com.apple.documentation/documentation/SwiftUI/View/previewLayout(_:)> view modifier. For example, you can tell the preview to take up only the amount of space that the view requires with ``sizeThatFits``: struct CircleImage_Previews: PreviewProvider { static var previews: some View { CircleImage() .previewLayout(.sizeThatFits) } } > Note: When you migrate away from preview providers and to preview macros, you specify layout using one of the ``PreviewTrait`` layout values with a macro that takes traits, like <doc://com.apple.documentation/documentation/SwiftUI/Preview(_:traits:_:body:)>.

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All DeveloperToolsSupport types →