<!--
{
  "availability" : [
    "iOS: 14.0 -",
    "iPadOS: 14.0 -",
    "macCatalyst: 14.0 -",
    "macOS: 11.0 -",
    "tvOS: 14.0 -",
    "visionOS: 1.0 -",
    "watchOS: 7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeveloperToolsSupport",
  "identifier" : "/documentation/DeveloperToolsSupport",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "DeveloperToolsSupport"
    ],
    "preciseIdentifier" : "DeveloperToolsSupport"
  },
  "title" : "DeveloperToolsSupport"
}
-->

# DeveloperToolsSupport

Expose custom views and modifiers in the Xcode library.

## Overview

Using the DeveloperToolsSupport framework, you tell Xcode about your custom
SwiftUI views and view modifiers. After adding your views and modifiers, Xcode
makes them available to you when
you click the Library button (`+`) in Xcode’s toolbar. You can select and drag
the custom library items into code, just like you would for system-provided
items.

To add items to the library, create a structure that conforms to the
[`LibraryContentProvider`](/documentation/DeveloperToolsSupport/LibraryContentProvider) protocol and encapsulate any
items you want to add as [`LibraryItem`](/documentation/DeveloperToolsSupport/LibraryItem) instances.
Implement the [`views`](/documentation/DeveloperToolsSupport/LibraryContentProvider/views)
computed property to add library items containing views. Implement the
[`modifiers(base:)`](/documentation/DeveloperToolsSupport/LibraryContentProvider/modifiers(base:))
method to add items containing view modifiers.
Xcode harvests items from all of the library content providers in your project
as you work, and makes them available to you in its library.

## Topics

### Library customization

[`protocol LibraryContentProvider`](/documentation/DeveloperToolsSupport/LibraryContentProvider)

A source of Xcode library and code completion content.

[`struct LibraryItem`](/documentation/DeveloperToolsSupport/LibraryItem)

A single item to add to the Xcode library.

### Preview definition

[`struct Preview`](/documentation/DeveloperToolsSupport/Preview)

A base type that preview macros use to create previews.

[`enum PreviewLayout`](/documentation/DeveloperToolsSupport/PreviewLayout)

A size constraint for a preview.

[`struct PreviewTrait`](/documentation/DeveloperToolsSupport/PreviewTrait)

Customizations that you can apply to a preview.

[`protocol PreviewRegistry`](/documentation/DeveloperToolsSupport/PreviewRegistry)

A protocol that the system uses to locate previews at runtime.

### Preview camera management

[`struct PreviewCamera`](/documentation/DeveloperToolsSupport/PreviewCamera)

A camera that defines a viewpoint in a preview.

[`struct PreviewCameraBuilder`](/documentation/DeveloperToolsSupport/PreviewCameraBuilder)

A builder type that composes a collection of cameras for previewing a
view in a 3D scene.

### Resource definition

[`struct ColorResource`](/documentation/DeveloperToolsSupport/ColorResource)

A color resource.

[`struct ImageResource`](/documentation/DeveloperToolsSupport/ImageResource)

An image resource.

### Structures

[`struct PreviewArguments`](/documentation/DeveloperToolsSupport/PreviewArguments)

[`struct PreviewBodyBuilder`](/documentation/DeveloperToolsSupport/PreviewBodyBuilder)

Builder for preview body content within a `#Preview` macro.

[`struct PreviewMacroBodyBuilder`](/documentation/DeveloperToolsSupport/PreviewMacroBodyBuilder)

Builder for preview body content within a `#Preview` macro.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)