Functions
The following functions are available globally.
-
Returns a Boolean indicating whether the errors are identical.
Declaration
Swift
public func == (lhs: ErrorType, rhs: ErrorType) -> Bool { // swiftlint:disable:this valid_docs
-
Pattern matching matching for
Realm.Error
, so that the instances can be used with Swift’sdo { ... } catch { ... }
syntax.Declaration
Swift
public func ~= (lhs: Error, rhs: ErrorType) -> Bool { // swiftlint:disable:this valid_docs
-
Returns the schema version for a Realm at a given local URL.
Throws
An
NSError
that describes the problem.Declaration
Swift
public func schemaVersionAtURL(fileURL: NSURL, encryptionKey: NSData? = nil) throws -> UInt64
Parameters
fileURL
Local URL to a Realm file.
encryptionKey
64-byte key used to encrypt the file, or
nil
if it is unencrypted.Return Value
The version of the Realm at
fileURL
. -
Performs the given Realm configuration’s migration block on a Realm at the given path.
This method is called automatically when opening a Realm for the first time and does not need to be called explicitly. You can choose to call this method to control exactly when and how migrations are performed.
Declaration
Swift
public func migrateRealm(configuration: Realm.Configuration = Realm.Configuration.defaultConfiguration) -> NSError?
Parameters
configuration
The Realm configuration used to open and migrate the Realm.
Return Value
An
NSError
that describes an error that occurred while applying the migration, if any.
-
Returns whether the two object schemas are equal.
Declaration
Swift
public func == (lhs: ObjectSchema, rhs: ObjectSchema) -> Bool { // swiftlint:disable:this valid_docs
-
Returns whether the two property objects are equal.
Declaration
Swift
public func == (lhs: Property, rhs: Property) -> Bool { // swiftlint:disable:this valid_docs
-
Returns a Boolean indicating whether two
Realm
instances are equal.Declaration
Swift
public func == (lhs: Realm, rhs: Realm) -> Bool { // swiftlint:disable:this valid_docs
-
Returns a Boolean value that indicates whether two
Schema
instances are equivalent.Declaration
Swift
public func == (lhs: Schema, rhs: Schema) -> Bool { // swiftlint:disable:this valid_docs
-
Returns whether the two sort descriptors are equal.
Declaration
Swift
public func == (lhs: SortDescriptor, rhs: SortDescriptor) -> Bool