I think the problem here is not to do with how to add domains but a mis-understanding of the scoping of username.
Yes username is scoped to a domain, user_id is a global unique identifier (across domains). Swift (and others) shouldn't need to do anything about becoming domain aware but it should be using the user_id to identify it's users not username. The same thing applies to projects (was tenants). The project name is only unique within a domain, the project id should be globally unique.
I think the problem here is not to do with how to add domains but a mis-understanding of the scoping of username.
Yes username is scoped to a domain, user_id is a global unique identifier (across domains). Swift (and others) shouldn't need to do anything about becoming domain aware but it should be using the user_id to identify it's users not username. The same thing applies to projects (was tenants). The project name is only unique within a domain, the project id should be globally unique.