Preview(_:widget:relevanceEntries:)
Preview a relevance configuration widget.
Declaration
@freestanding(declaration) macro Preview<Widget, Entry>(_ name: String? = nil, widget: @escaping @MainActor () -> Widget, @PreviewRelevanceEntryBuilder<Entry> relevanceEntries: @escaping @MainActor () async -> [Entry]) where Widget : Widget, Entry : RelevanceEntryParameters
- name:
An optional display name for the preview that appears in the Xcode preview canvas.
- widget:
A closure producing the widget to be previewed.
- relevanceEntries:
A closure building the entries to be previewed.
Overview
Provide the preview with sample data and use it to step through the timeline while ignoring the dates of the entries, and test out the transitions between them.