ESTSettingNearableInterval

@interface ESTSettingNearableInterval : ESTSettingReadWrite <NSCopying>

ESTSettingNearableInterval represents Nearable Interval value.

  • Designated initializer. Validates provided value internally with +validationErrorForValue:.

    See

    +[ESTSettingNearableInterval validationErrorForValue:]

    Declaration

    Objective-C

    - (nonnull instancetype)initWithValue:(unsigned short)interval;

    Swift

    init(value interval: UInt16)

    Parameters

    interval

    Nearable Interval value.

    Return Value

    Initialized object. Nil if validation fails.

  • Returns current value of Nearable Interval setting.

    Declaration

    Objective-C

    - (unsigned short)getValue;

    Swift

    func getValue() -> UInt16

    Return Value

    Nearable Interval value.

  • Method allows to read value of initialized Nearable Interval setting object.

    Declaration

    Objective-C

    - (void)readValueWithCompletion:
        (nonnull ESTSettingNearableIntervalCompletionBlock)completion;

    Swift

    func readValue(completion: @escaping ESTSettingNearableIntervalCompletionBlock)

    Parameters

    completion

    Block to be invoked when operation is complete.

    Return Value

    Initialized operation object.

  • Method allows to create write operation from already initialized Nearable Interval setting object. Value provided during initialization will be used as a desired value.

    Declaration

    Objective-C

    - (void)writeValue:(unsigned short)interval
            completion:
                (nonnull ESTSettingNearableIntervalCompletionBlock)completion;

    Swift

    func writeValue(_ interval: UInt16, completion: @escaping ESTSettingNearableIntervalCompletionBlock)

    Parameters

    interval

    Interval value to be written to the device.

    completion

    Block to be invoked when operation is complete.

    Return Value

    Initialized operation object.

  • Method checks if provided value is allowed. Returns nil if validation passes.

    Declaration

    Objective-C

    + (NSError *_Nullable)validationErrorForValue:(unsigned short)interval;

    Swift

    class func validationError(forValue interval: UInt16) -> Error?

    Parameters

    interval

    Interval value.

    Return Value

    Error object describing why validation failed. Nil if validation passes.