I’ve complained LLMs are bad at SwiftUI, and that’s not entirely accurate.

It has bad default approaches, because it’s all trained stale StackOverflow answers. It can be steered in the right direction if you know what you’re doing, but that’s kind of the problem.

I’ve said it before and I’ll say it again: Apple needs to massively improve its documentation and sample code to overcome this. Thousands of sample projects, actively maintained.

(Hi WWDR! Hire me to do this!)

Addendum: there’s bad SwiftUI code, ignorant of modern API, bashing HStacks and GeometryReaders together until something works. That needs training to overcome.

Then there’s failures of the framework. Like how you can attach an alert to a button, but not if it’s inside a menu. Or how you can add toolbar items to a bare window on macOS but not on iOS.

Those are failures of “learn once, write everywhere” and Apple needs to be better about them. Too many caveats, too many gotchas.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/clarko/statuses/116054210848433861 on your instance and quote it. (Note that quoting is not supported in Mastodon.)