mardi 12 décembre 2017

In Swift, how do you get the fully-qualified type name?

Consider this code in an app called 'MyApp'...

class Foo{
    class Laa{
        static let LaaCmd = "I am Laa Command"
    }
}

How can I programmatically get the string "MyApp.Foo.Laa.LaaCmd"?

Bonus Question

Given the above code, and a variable containing the string "MyApp.Foo.Laa.LaaCmd", how can I get the value "I am Laa Command"?





Aucun commentaire:

Enregistrer un commentaire