I have a ViewModifier that I use by extending View as such:
I tried adding it to the Library as such:
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.
Code Block extension View { func asCard() -> some View { self.modifier(CardViewModifier()) } }
I tried adding it to the Library as such:
Code Block @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.