Skip to content

Instantly share code, notes, and snippets.

@ericlewis
Created November 18, 2021 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericlewis/83f78f7a422e9fc0651a32360f1e3f1e to your computer and use it in GitHub Desktop.
Save ericlewis/83f78f7a422e9fc0651a32360f1e3f1e to your computer and use it in GitHub Desktop.
lol
// Works.
extension VW {
public static func buildBlock<Content: DynamicViewContent>(_ content: Content) -> some View where Content.Data: RandomAccessCollection, Content.Data.Element: Identifiable {
ViewBuilder.buildBlock(VStack { ForEach(content.data) { _ in Text("Test") } })
}
}
// Crashes
extension VW {
public static func buildBlock<Content: DynamicViewContent>(_ content: Content) -> some View where Content.Data: RandomAccessCollection, Content.Data.Element: Identifiable {
ViewBuilder.buildBlock(VStack { ForEach(content.data) { _ in Text("Test") } })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment