feat(variable): Allow Swift type introspection

This commit is contained in:
Kyle Fuller
2016-11-28 06:13:46 +00:00
parent 9af9cf4005
commit 38d7ec87f6
7 changed files with 57 additions and 12 deletions

View File

@@ -87,6 +87,13 @@ public struct Variable : Equatable, Resolvable {
#else
current = object.value(forKey: bit)
#endif
} else if let value = current {
let mirror = Mirror(reflecting: value)
current = mirror.descendant(bit)
if current == nil {
return nil
}
} else {
return nil
}