Post #1249906
2026-03-30 00:18 UTC
@kylebshr @kyleve Great idea! Any plans on expanding this for ViewBuilders and EmptyView slots? That’s far and away my most common use of multiple initializers, for example when I make a custom View that has an optional header and footer requiring 3 extra inits to handle the situations where one or both are EmptyView.
Replies (1)
-
@kylebshr@mastodon.social 2026-03-30 00:21
@mergesort I think you'll find that's exactly what this handles? Except you define optionality with true optionals, and the init extensions use Never to express optional slots instead of EmptyView (something I never thought of until Claude suggested it). I suggest reading the readme, I don't know if my snippet fully captures the functionality. Curious if you still think this doesn't solve your use case.