I have made very good experiences using Swift to teach people programming in general as well as in the context of app development (i.e. Apple platform applications). My audience, however, usually consists of (adult) trainees and/or university students, I have not worked much with kids.
A point I would explicitly add to the good list of @tommyming would be Swift's "local reasoning" principle: It is a lot easier, in my experience, if learners can focus on a limited number of lines in one file when trying to figure out what's going on.
Concurrency, by necessity, subverts this local reasoning to an extent. While the "structured" part in Swift's paradigm mitigates this somewhat, we are fundamentally teaching "what happens if two different things have to occur concurrently" when we have to introduce it to any newcomer.
So IMO it is kind of understandable that there's friction, and things like static global variables have to be explained in more detail than is probably desirable.
How much of a problem this becomes during teaching depends on the circumstances:
- How soon will the students run into problems with this?
- Are they mostly learning by themselves, relying on compiler errors and warnings, or do they have a teacher present?
Naturally point 2 is easier to address: Indeed, if learning on their own, the current state of things makes it hard for them. Unfortunately I don't know exactly what we could do here other than maybe tweak documentation and compiler fix-its, etc.
If they can ask a teacher, I think it is okay to provide a fix for now and delay a more detailed explanation ("We will use instance variables for now and learn why later"). I believe in Swift such a delayed explanation would be relatively rare (generics would be another one, although it's less likely the student runs into them "on accident"), so there's not too great a risk of "getting lost in future outlooks".
Point 1 is something that seems to not be addressed in this thread so far.
To me it reads as if most people assume a "classic" intro into programming: Write very simple code like "Hello World" and such, which implies more or less linear, non-looped command line programs that output things to the console. In my experience this is good if you want to focus on the underlying principles like "How does a program actually compute things?", "What is an algorithm?", and pieces of data structures.
As the examples show, I think this also introduces a high chance students would write code that triggers concurrency warnings (thus exposing them to the concept relatively early).
However, I've also come to learn that this approach when introducing programming can be demotivating for many students, especially if they're not already "STEM hyped". They often want to see how "real apps" are made, i.e. hope that when writing some code and pressing a button, the result will be a window that pops up and can be interacted with.
The SwiftUI tutorial on the Apple pages address this by immediately jumping into concrete UI development. The resulting "Landscapes" app does provide a pretty quick success for students and I have seen them get hyped for more, which makes explaining "regular, boring code" then easier.
Of course there's a downside to this: SwiftUI itself is, like concurrency, relying on high-level concepts like result builders, opaque result types (and thus protocols), and a flat-out black-box in terms of how "those weird structs" manifest into actual graphics on the screen. It does, however, deliver a decent introduction that illustrates a complex program without delving into concurrency [1].
In the past, before Swift and SwiftUI I have once worked with a UIKit app template and tried a kind of "hybrid" approach: Students could see a "regular UI" and I did actually start with "how to add a button", but then connected it to a place in code that allowed them to execute simple code as if they would work in a playground. It's been a while, though and I don't know if I still have the template...
[1]
At least the last time I checked it...