Adding comments to some of the CCX extensions & mirroring protocol object

This commit is contained in:
Ryan Coyne 2017-11-30 15:18:47 -05:00
parent d81a777954
commit 715bdbd6c2
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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
}