Protocol

PreviewProvider

A type that produces view previews in Xcode.

Declaration

protocol PreviewProvider

Overview

Xcode statically discovers types that conform to the PreviewProvider protocol in your app, and generates previews for each provider it discovers.

Topics

Setting the Type

associatedtype Previews

The type to preview.

Required.

Generating Previews

static var platform: PreviewPlatform?

The platform on which to run the provider.

Required. Default implementation provided.

static var previews: Self.Previews

Generates a collection of previews.

Required.