Adding comments to some of the CCX extensions & mirroring protocol object
This commit is contained in:
parent
d81a777954
commit
715bdbd6c2
|
@ -117,7 +117,7 @@ extension Array where Iterator.Element == Mirror {
|
|||
}
|
||||
})
|
||||
}
|
||||
// Lets make sure if the primaryKey is set, it is the first object returned for asData/asDataDic functions:
|
||||
// Lets make sure if the primaryKey is set, it is the first object returned for asData/asDataDic & firstAsKey functions:
|
||||
if let keyLabel = primaryKey, allChild.first?.label != keyLabel {
|
||||
if let index = allChild.index(where: { (child) -> Bool in
|
||||
return child.label == keyLabel
|
||||
|
|
|
@ -25,6 +25,10 @@ open class CCXMirror: CCXMirroring {
|
|||
public func didInitializeSuperclass() {
|
||||
self.superclassCount += 1
|
||||
}
|
||||
|
||||
/// This is intended to make it easier to specify your primary key, rather than having the id specifically in this model.
|
||||
///
|
||||
/// - Returns: This returns the label for the primary key for this model.
|
||||
open func primaryKeyLabel() -> String? {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue