ESTDeviceSettingsCollection

@interface ESTDeviceSettingsCollection : NSObject <NSCopying>

ESTDeviceSettingsCollection represents collection of device settings.

  • Method allows to initialize object with array of settings.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSettingsArray:
        (nonnull NSArray<ESTSettingBase *> *)settingsArray;

    Swift

    init(settingsArray: [ESTSettingBase])

    Parameters

    settingsArray

    Array of settings.

    Return Value

    Initialized object.

  • Method allows to set device setting represented by object implementing ESTSettingProtocol protocol. When setting was already set, it will be updated with value from provided one.

    Declaration

    Objective-C

    - (void)addOrReplaceSetting:(nonnull ESTSettingBase *)setting;

    Swift

    func addOrReplaceSetting(_ setting: ESTSettingBase)

    Parameters

    setting

    Setting should be set.

  • Method allows to set device settings represented by objects implementing ESTSettingProtocol protocol. When a setting was already set, it will be updated with value from provided one.

    Batch version of -addOrReplaceSetting method.

    Declaration

    Objective-C

    - (void)addOrReplaceSettings:(nonnull NSArray<ESTSettingBase *> *)settings;

    Swift

    func addOrReplaceSettings(_ settings: [ESTSettingBase])

    Parameters

    settings

    Setting should be set.

  • Method allows to get Setting represented by particular class.

    Declaration

    Objective-C

    - (nullable id)getSettingForClass:(nonnull Class)targetedClass;

    Swift

    func getSettingFor(_ targetedClass: AnyClass) -> Any?

    Parameters

    targetedClass

    Class of setting that should be get.

    Return Value

    Setting for class. Nil means no setting was set for this class or there are multiple settings avaialable.

  • Method allows to get all available instances of settings represented by particular class.

    Declaration

    Objective-C

    - (nullable NSArray<ESTSettingBase *> *)getAllSettingsForClass:
        (nonnull Class)targetedClass;

    Swift

    func getAllSettings(for targetedClass: AnyClass) -> [ESTSettingBase]?

    Parameters

    targetedClass

    Class of setting that should be get.

    Return Value

    Array of settings for class. Nil means no setting was set for this class.

  • Methods allows to get all settings that was set in NSArray representation.

    Declaration

    Objective-C

    - (nonnull NSArray *)getSettings;

    Swift

    func getSettings() -> [Any]

    Return Value

    Array of all set settings.