I have a ViewModifier that I use by extending View as such: extension View { func asCard() -> some View { self.modifier(CardViewModifier()) } } I tried adding it to the Library as such: @LibraryContentBuilder func modifiers(base: View) -> [LibraryItem] { LibraryItem(base.asCard) } But that produces the following error message: Protocol 'View' can only be used as a generic constraint because it has Self or associated type requirements I also tried using Any but that didn't work either.
Search results for
[tags:apple pay,wallet]
6 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is the custom view/modifier backwards compatible with SwiftUI on iOS 13? Or does it require iOS 14
The customization of the std library is an interesting feature. I see this as helping me - on my Mac (compile device) but how does the rest of my team get these custom views & modifiers. When/how is this pushed out to others in our network?
I face compilation error in Xcode 11.5 for iOS 13.5 even when declaring that my LibraryContentProvider shall be available for iOS 14 only. Error Use of undeclared type 'LibraryContentProvider' Code @available(iOS 14.0, *) struct LibraryContent : LibraryContentProvider { @LibraryContentBuilder var views: [LibraryItem] { LibraryItem( Text(Hello WWDC!), title: Custom View In The Library ) } } How to avoid this? I am asking because I'd like to ship my custom LibraryContentProvider as early as possible for people using Xcode 12 beta but I need to avoid compilation error for Xcode 11.5 users, of course :)
Items in the library built by Apple provide details in the form of documentation. I added documentation to my custom views, but that is not displayed when I added my view to the library. I didn’t see a way to populate this details section for custom views and modifiers in the talk or in documentation. Is this available already and I missed it?
Where I can download the codes of WWDC2020 Introduction to SwiftUI