Created
August 20, 2022 21:57
-
-
Save MarcoEidinger/1d551727cb2564216bcae2a7789351d6 to your computer and use it in GitHub Desktop.
Example for a view and its LibraryContentProvider implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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