Skip to content

Instantly share code, notes, and snippets.

@MarcoEidinger
Created August 20, 2022 21:57
Show Gist options
  • Save MarcoEidinger/1d551727cb2564216bcae2a7789351d6 to your computer and use it in GitHub Desktop.
Save MarcoEidinger/1d551727cb2564216bcae2a7789351d6 to your computer and use it in GitHub Desktop.
Example for a view and its LibraryContentProvider implementation
import SwiftUI
/// Example of an reusable SwiftUII view available in the Xcode library
struct CalendarView: View {
var body: some View {
Text("A fake calendar view :)")
}
}
@available(iOS 14.0, *)
@available(macOS 11.0, *)
struct CalendarView_LibraryViewContents: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(CalendarView())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment