Elektrine lite

← Feed

@kylebshr@mastodon.social

Post #1249914

2026-03-31 14:45 UTC

@mergesort how would you feel if headerView was optional, and instead of where == EmptyView you used where == Never and assigned nil? Ignoring slots for a moment, I think this is a slightly better design that accomplishes the same thing, because internally you might want to adjust layout based on headerViews presence, e.g., in the body: if let headerView { Spacer() headerView }

Replies (1)

  • @kylebshr@mastodon.social 2026-03-31 14:46

    @mergesort now, assuming you’re ok with this design (which is just a design choice) yes, slots does exactly what you did in the gist, but automatically

    Open ##1249915