Skip to content

Instantly share code, notes, and snippets.

@justinHowlett
Created October 22, 2014 03:29
Show Gist options
  • Save justinHowlett/35f8c5929c90fbf038e5 to your computer and use it in GitHub Desktop.
Save justinHowlett/35f8c5929c90fbf038e5 to your computer and use it in GitHub Desktop.
Basic mirroring in Swift
let mirror = reflect(objectInstance)
for index in 0 ..< mirror.count {
let (childKey, childMirror) = mirror[index]
println("key is \(childKey)")
println("value is \(childMirror.value)")
println("valuetype is \(childMirror.valueType)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment