Preview(_:traits:body:)
Preview an NSViewController.
Declaration
@freestanding(declaration) macro Preview(_ name: String? = nil, traits: PreviewTrait<Preview.ViewTraits>..., @PreviewMacroBodyBuilder<NSViewController> body: @escaping @MainActor () -> NSViewController)Parameters
- name:
Optional display name for the preview, which will appear in the canvas.
- traits:
Optional list of traits customizing the appearance of the preview.
- body:
A closure producing an NSViewController.