One Logo Pool Ball
Developer Tools · IOS API REFERENCE

DeveloperToolsSupport

Expose custom views and modifiers in the Xcode library.

15 types

20 callable entries

7 skipped

74% entry coverage

Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.

Types

Functions and constants

static · iOS 17.0+

fixedLayout

TypeScript
static fixedLayout(width: number, height: number): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static func fixedLayout(width: CGFloat, height: CGFloat) -> PreviewTrait<T>

Center the preview in a fixed size container with the given dimensions. This is the same as ``PreviewLayout/fixed(width:height:)``.

get · iOS 17.0+

defaultLayout

TypeScript
static get defaultLayout(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var defaultLayout: PreviewTrait<Preview.ViewTraits> { get }

Center the preview in a container the size of the device on which the preview is running. This is the same as the ``PreviewLayout/device`` layout, and is the default if you don't specify a layout trait.

get · iOS 17.0+

landscapeLeft

TypeScript
static get landscapeLeft(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var landscapeLeft: PreviewTrait<Preview.ViewTraits> { get }

The device is in landscape mode, with the top of the device on the left. This is the same as <doc://com.apple.documentation/documentation/SwiftUI/InterfaceOrientation/landscapeLeft>.

get · iOS 17.0+

landscapeRight

TypeScript
static get landscapeRight(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var landscapeRight: PreviewTrait<Preview.ViewTraits> { get }

The device is in landscape mode, with the top of the device on the right. This is the same as <doc://com.apple.documentation/documentation/SwiftUI/InterfaceOrientation/landscapeRight>.

get · iOS 26.0+

assistiveAccess

TypeScript
static get assistiveAccess(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var assistiveAccess: PreviewTrait<Preview.ViewTraits> { get }

Apply the visual style used in Assistive Access on iOS and iPadOS. On other platforms, this is a no-op.

get · iOS 17.0+

portraitUpsideDown

TypeScript
static get portraitUpsideDown(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var portraitUpsideDown: PreviewTrait<Preview.ViewTraits> { get }

The device is in portrait mode, but is upside down. This is the same as <doc://com.apple.documentation/documentation/SwiftUI/InterfaceOrientation/portraitUpsideDown>.

get · iOS 17.0+

sizeThatFitsLayout

TypeScript
static get sizeThatFitsLayout(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var sizeThatFitsLayout: PreviewTrait<Preview.ViewTraits> { get }

Fit the container to the size of the preview when offered the size of the device that the preview is running on. This is the same as ``PreviewLayout/sizeThatFits``.

get · iOS 17.0+

portrait

TypeScript
static get portrait(): Promise<PreviewTrait<Preview_ViewTraits>>
Swift declaration
@MainActor static var portrait: PreviewTrait<Preview.ViewTraits> { get }

The device is in portrait mode, with the top of the device on top. This is the same as <doc://com.apple.documentation/documentation/SwiftUI/InterfaceOrientation/portrait> and is the default orientation if you don't specify one.

static · iOS 18.0+

buildBlock

TypeScript
static buildBlock(content: unknown): unknown
Swift declaration
static func buildBlock(_ content: Content) -> Content
static · iOS 17.0+

buildBlock

TypeScript
static buildBlock(arg0: unknown): unknown
Swift declaration
static func buildBlock(_: Content) -> Content

Skipped declarations

7 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

LibraryItem.init(_:visible:title:category:matchingSignature:)

callback cannot propagate synchronous failure

LibraryContentBuilder.buildBlock(_:)

A variable number of Swift arguments is not supported.

LibraryContentProvider.modifiers(base:)

The iOS SDK compiler rejected this binding: cannot access associated type 'ModifierBase' from 'LibraryContentProvider'; use a concrete type or generic parameter base instead

PreviewRegistry.preview

Static protocol requirements cannot be called through an instance.

PreviewTrait.init(_:)

A variable number of Swift arguments is not supported.

protocol implementation LibraryContentProvider

This protocol needs associated types that cannot yet cross the bridge.

protocol implementation PreviewRegistry

non-method protocol requirement