It is possible to know the name of a struct in swift ? I know this is possible for class
:
Example
class Example {
var variable1 = "one"
var variable2 = "2"
}
printing this class name, I would simply do:
NSStringFromClass(Example).componentsSeparatedByString(".").last!
but can I do something similar for struct
?
Example
If i have a struct
:
struct structExample {
var variable1 = "one"
var variable2 = "2"
}
how can I get the name "structExample" of this struct
?
Thanks.