Is there a Simple way in Swift to iterate over the attributes of a class.
i.e. i have a class Person, and it has 3 attributes: name, lastname, age.
is there something like
for attribute in Person {
println("(attribute): (attribute.value)")
}
the output would be for example:
name: Bob
lastname: Max
age: 20
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…