4 ms·
Probably my favorite aspect of Swift as well, enums + payloads/associated types make for extremely safe and easy to understand code. Combine it with switches a
by newZWhoDis 3y ago
Probably my favorite aspect of Swift as well, enums + payloads/associated types make for extremely safe and easy to understand code.
Combine it with switches and you get compiler guarantees that every state is explicitly handled, and if you are in a particular state you always have the relevant child objects.
I remember being shocked dart lacked this functionality when I tried out flutter.