Declaration

Initialize a standalone (unpersisted) Object with values from an Array<AnyObject> or Dictionary<String, AnyObject>.
Call add(_:) on a Realm to add standalone objects to a realm.

Declaration

Swift

publicinit(value:AnyObject)

Parameters

value

The value used to populate the object. This can be any key/value coding compliant
object, or a JSON object such as those returned from the methods in NSJSONSerialization,
or an Array with one object for each persisted property. An exception will be
thrown if any required properties are not present and no default is set.

Declaration

Override to designate a property as the primary key for an Object subclass. Only properties of
type String and Int can be designated as the primary key. Primary key
properties enforce uniqueness for each value whenever the property is set which incurs some overhead.
Indexes are created automatically for primary key properties.

Declaration

Swift

publicclassfuncprimaryKey()->String?{returnnil}

Return Value

Name of the property designated as the primary key, or nil if the model has no primary key.