Badly. Well, not badly but it needs a lot of hand holding. If you don’t know how Swift or any language you won’t be able to guide it and check what it is doing wrong.
I tried using ChatGPT to build the basic template of a messaging app and for the super basic 100ish line template it did OK, but when I started to ask it to add small features it would start to break and add bugs. It then had trouble fixing the bugs and replaced them with new bugs. It was also trying to use Python properties in the middle of Swift code. When I pointed out the error it apologized and replaced the Python with yet another Python property.
It’s a natural language model so it’s not suitable for physics, math or coding because those were not the intended purpose. It attempts those because it has scraped a lot of web data, but it fails in many places.
If machine learning is used to help developers it would need to use several models side by side, one for language, one for number crunching, one for coding, etc.