Skip to main content

PrimaryKey

@objc public protocol PrimaryKey: AnyObject 
  • The name of the property that acts as primary key for objects of this class. Primary key values are expected to remain the same
  • for the lifetime of the object, and they are expected to be unique.
  • Valid types are String, Int and UUID for Core Data, and String, Int and ObjectId for Realm.

Inheritance#

AnyObject

Requirements#

primaryKey()#

Name of the primary key property.

static func primaryKey() -> String