Ancestors

Written by David Beck :xcode: on 2024-11-20 at 18:51

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

Written by David Beck :xcode: on 2024-11-20 at 18:53

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

Toot

Written by David Beck :xcode: on 2024-11-21 at 05:59

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

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113519414889632427
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
261.329391 milliseconds
Gemini-to-HTML Time
0.407717 milliseconds

This content has been proxied by September (ba2dc).