swift2 - reflect property value on swift 2.0 -
how can fetch property value on swift 2.0? on swift 1.0, can mirror value value property, cannot find api this. new mirror type on swift 2.0 has few api. there other way achieve this?
this usage of reflection swift 2.
let mirror = mirror(reflecting: obj) child in mirror.children { guard let key = child.label else { continue } let value = child.value // use value or key here }
Comments
Post a Comment