RLMSchema
Objective-C
@interface RLMSchema : NSObject <NSCopying>
Swift
@_nonSendable(_assumed) class RLMSchema : NSObject, NSCopying, @unchecked Sendable
RLMSchema
instances represent collections of model object schemas managed by a Realm.
When using Realm, RLMSchema
instances allow performing migrations and
introspecting the database’s schema.
Schemas map to collections of tables in the core database.
-
An
NSArray
containingRLMObjectSchema
s for all object types in the Realm.This property is intended to be used during migrations for dynamic introspection.
See
RLMObjectSchema
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<RLMObjectSchema *> *_Nonnull objectSchema;
Swift
var objectSchema: [RLMObjectSchema] { get }
-
Returns an
RLMObjectSchema
for the given class name in the schema.See
Declaration
Objective-C
- (nullable RLMObjectSchema *)schemaForClassName:(nonnull NSString *)className;
Swift
func schema(forClassName className: String) -> RLMObjectSchema?
Parameters
className
The object class name.
Return Value
An
RLMObjectSchema
for the given class in the schema. -
Looks up and returns an
RLMObjectSchema
for the given class name in the Realm.If there is no object of type
className
in the schema, an exception will be thrown.See
Declaration
Objective-C
- (nonnull RLMObjectSchema *)objectForKeyedSubscript: (nonnull NSString *)className;
Swift
subscript(className: String) -> RLMObjectSchema { get }
Parameters
className
The object class name.
Return Value
An
RLMObjectSchema
for the given class in this Realm. -
Returns whether two
RLMSchema
instances are equivalent.Declaration
Objective-C
- (BOOL)isEqualToSchema:(nonnull RLMSchema *)schema;
Swift
func isEqual(to schema: RLMSchema) -> Bool