RLMSchema
@interface RLMSchema : NSObject <NSCopying>
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 (readonly, copy, nonatomic) 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 schemaForClassName(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 id<NSCopying>)className;
Swift
subscript (className: NSCopying) -> RLMObjectSchema { get }
Parameters
className
The object class name.
Return Value
An
RLMObjectSchema
for the given class in this Realm. -
Returns a Boolean value that indicates whether two
RLMSchema
instances are equivalent.Declaration
Objective‑C
- (BOOL)isEqualToSchema:(nonnull RLMSchema *)schema;
Swift
func isEqualToSchema(schema: RLMSchema) -> Bool