Elektrine lite

← Feed

@kylebshr@mastodon.social

Post #922454

2026-03-30 00:02 UTC

I have no technical ability. I know nothing about Swift macros. But I have confidence in my taste, and the ability to express what I feel. Introducing Slots - convenient view slots without the init explosion https://github.com/kylebshr/slots

Replies (6)

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

    For anyone who doesn't get the reference https://www.tiktok.com/@60minutes/video/7189964392400833834?lang=en

    Open ##1249897

  • @kylebshr@mastodon.social 2026-03-30 20:08

    @fatbobman I think you might like this!

    Open ##1249898

  • @kyleve@mastodon.online 2026-03-30 00:09

    @kylebshr yesss this is great

    Open ##1249899

  • @mergesort@macaw.social 2026-03-30 00:18

    @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.

    Open ##1249906

  • @mergesort@macaw.social 2026-03-30 00:25

    @kylebshr I did read through the readme before responding. (Twice actually. 🙂) I’m a little unsure as to how it would handle the EmptyView scenario I mentioned, given you wouldn’t actually store it as nil but as a “slotted type”. In the icon example why is the annotation `.text`? I would expect something like `.empty`, but perhaps I’m completely misunderstanding how this is supposed to work.

    Open ##1249909

  • @nesevis@hachyderm.io 2026-03-30 08:07

    @kylebshr Very cool!

    Open ##1249923