Elektrine lite

← Feed

@kylebshr@mastodon.social

Post #1249910

2026-03-30 00:53 UTC

@mergesort maybe you can describe what you’re trying to accomplish with EmptyView? Not sure *I* fully understand, but if I do I’ll try to explain it better

Replies (1)

  • @kylebshr@mastodon.social 2026-03-30 01:00

    @mergesort I think I understand what you’re trying to do, and instead of something like `.empty` I’ve used the type system for this; optional view properties get init variations where they’re omitted from the init, and they get set to nil (and constrained to Never, though you could constraint to EmptyView for the same effect). I prefer optional views instead of views that may be EmptyView, because you can customize the layout based on their presence instead of checking the type.

    Open ##1249911