RBBaseThemeSet Class Reference

Inherits from NSObject
Declared in RBBaseThemeSet.h

Overview

The base class for storing and processing a theme set.

  platformOverridePostfixes

An array of the postfix strings that serve as overrides for this platform. For example, the postfix ‘_iPad’ will result in all keys ending with that string being chosen over those that do not.

@property (nonatomic, readonly, nullable) NSArray<NSString*> *platformOverridePostfixes

Discussion

An array of the postfix strings that serve as overrides for this platform. For example, the postfix ‘_iPad’ will result in all keys ending with that string being chosen over those that do not.

Declared In

RBBaseThemeSet.h

– initWithPlatformOverridePostfixes:

Initializes the theme set object using the given override postfixes.

- (nonnull instancetype)initWithPlatformOverridePostfixes:(nullable NSArray<NSString*> *)platformOverridePostfixes

Parameters

platformOverridePostfixes

The array of override postfix strings.

Return Value

The initialized object.

Discussion

Initializes the theme set object using the given override postfixes.

Declared In

RBBaseThemeSet.h

– resolvePlatformOverridesInPropertyList:

Resolves platform overrides in the given property list.

- (nonnull id)resolvePlatformOverridesInPropertyList:(nonnull id)propertyList

Parameters

propertyList

The property list to resolve the overrides in.

Return Value

The resulting property list.

Discussion

Resolves platform overrides in the given property list.

Declared In

RBBaseThemeSet.h

+ isReferenceString:

Determines whether a given string is a valid constant reference. It also checks the type of the given value, and thus anything can be passed to it.

+ (BOOL)isReferenceString:(nonnull id)value

Parameters

value

The value to check.

Return Value

Whether or not the given value is a valid constant reference string.

Discussion

Determines whether a given string is a valid constant reference. It also checks the type of the given value, and thus anything can be passed to it.

Declared In

RBBaseThemeSet.h

+ nameFromReferenceString:

Extracts the name that is referred to by the given reference string e.g. ‘ref://color-background’ > ‘color-background’.

+ (nonnull NSString *)nameFromReferenceString:(nonnull NSString *)referenceString

Parameters

referenceString

The reference string.

Return Value

The extracted name.

Discussion

Extracts the name that is referred to by the given reference string e.g. ‘ref://color-background’ > ‘color-background’.

Declared In

RBBaseThemeSet.h

+ inheritanceReferenceNameWithDictionary:error:

Extracts the name of the reference that the dictionary should inherit from. Provides an error where one is specified but is invalid.

+ (nullable NSString *)inheritanceReferenceNameWithDictionary:(nonnull NSDictionary<NSString*,NSString*> *)dictionary error:(NSError *_Nullable *_Nullable)error

Parameters

dictionary

The dictionary to check.

error

A pointer to an NSError* that will be assigned in the case of an error.

Return Value

The extracted reference name, or nil.

Discussion

Extracts the name of the reference that the dictionary should inherit from. Provides an error where one is specified but is invalid.

Declared In

RBBaseThemeSet.h

+ dictionaryByRemovingReferenceInheritanceKey:

Removes the inheritance key from the given dictionary.

+ (nonnull NSDictionary<NSString*,NSString*> *)dictionaryByRemovingReferenceInheritanceKey:(nonnull NSDictionary<NSString*,NSString*> *)dictionary

Parameters

dictionary

The dictionary to remove the inheritance key from.

Return Value

The resulting dictionary with the inheritance key removed.

Discussion

Removes the inheritance key from the given dictionary.

Declared In

RBBaseThemeSet.h

+ resolveInheritanceReferenceInDictionary:lookup:error:

Resolves the inheritance reference of a given dictionary.

+ (void)resolveInheritanceReferenceInDictionary:(nonnull NSMutableDictionary<NSString*,NSString*> *)dictionary lookup:(nonnull id __nullable ( ^ ) ( NSString *__nonnull name , NSError *_Nullable *_Nullable blockError ))lookup error:(NSError *_Nullable *_Nullable)error

Parameters

dictionary

The dictionary to resolve the inheritance reference of.

lookup

A block that will be used to retrieve the resolved value for the given name.

error

A pointer to an NSError* that will be assigned in the case of an error.

Discussion

Resolves the inheritance reference of a given dictionary.

Declared In

RBBaseThemeSet.h