I think I just realized when Swift's type system goes from helpful to hurtful: when it stops being self documenting.
For instance, with a UILabel you can look at the type and know exactly what you can do with it. It has a lineBreakStrategy property, so you know that can be customized.
On the other hand, SwiftUI Text has almost no properties outside of what it inherits from View. So like a giant box of legos, you have to go searching for the modifiers that apply to Text.
=> More informations about this toot | More toots from david@tnku.co
Those modifiers are mostly wrappers around setting environment values. Which is super handy! I can set a font or text color on a view and it will apply to all the Text elements! I can customize the default!
But it also makes it much harder to find what changes what.
=> More informations about this toot | More toots from david@tnku.co
Where this really goes off the rails is when the compiler will enforce the type system but there’s no indication of what is allowed, for instance with result builders. What can go inside a Group? It depends! Except it depends in both directions. It’s based on its generic type, which can be effected by what you put in it, but also by what you put it in. Get it wrong and the compiler wraps itself in knots.
=> More informations about this toot | More toots from david@tnku.co
text/gemini
This content has been proxied by September (ba2dc).