Fixing last issues with mirroring & getting the correct superclasses
This commit is contained in:
parent
6cb4d45209
commit
4c73b20469
|
@ -29,22 +29,24 @@ open class CCXMirror: CCXMirroring {
|
||||||
private func superclassMirrors() -> [Mirror] {
|
private func superclassMirrors() -> [Mirror] {
|
||||||
var mirrors : [Mirror] = []
|
var mirrors : [Mirror] = []
|
||||||
let mir = Mirror(reflecting: self)
|
let mir = Mirror(reflecting: self)
|
||||||
|
|
||||||
mirrors.append(mir)
|
mirrors.append(mir)
|
||||||
print(mir.children.count)
|
|
||||||
var currentContext : Mirror?
|
var currentContext : Mirror?
|
||||||
for _ in 0...self.superclassCount {
|
for _ in 1...self.superclassCount {
|
||||||
if currentContext.isNil {
|
if currentContext.isNil {
|
||||||
currentContext = mir.superclassMirror
|
currentContext = mir.superclassMirror
|
||||||
} else {
|
} else {
|
||||||
currentContext = currentContext?.superclassMirror
|
currentContext = currentContext?.superclassMirror
|
||||||
}
|
}
|
||||||
if currentContext.isNotNil {
|
if currentContext.isNotNil {
|
||||||
|
// we only want to bring in the variables from the superclasses that are beyond PostgresStORM:
|
||||||
|
switch String(describing: currentContext!.subjectType) {
|
||||||
|
case "CCXMirror", "StORM", "PostgresStORM":
|
||||||
|
break
|
||||||
|
default:
|
||||||
mirrors.append(currentContext!)
|
mirrors.append(currentContext!)
|
||||||
}
|
}
|
||||||
print(currentContext?.children.count)
|
|
||||||
}
|
}
|
||||||
print(mirrors.count)
|
}
|
||||||
return mirrors
|
return mirrors
|
||||||
}
|
}
|
||||||
/// This returns all the children, even all the superclass mirrored children. Use allChildren().asData() to return an array of key/values.
|
/// This returns all the children, even all the superclass mirrored children. Use allChildren().asData() to return an array of key/values.
|
||||||
|
|
Loading…
Reference in New Issue