protocol LibraryContentProvider
struct LibraryItem
Technology
You can add your custom SwiftUI views and view modifiers to Xcode’s Library. This allows anyone developing your app or adopting your framework to access them by clicking 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 Library
protocol and encapsulate any items you want to add as Library
instances. Implement the views
computed property to add library items containing views. Implement the 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.
protocol LibraryContentProvider
struct LibraryItem