ESTSettingIBeaconMajor

@interface ESTSettingIBeaconMajor : ESTSettingReadWrite <NSCopying>

ESTSettingIBeaconMajor represents iBeacon major value broadcasted by the device.

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

    See

    +[ESTSettingIBeaconMajor validationErrorForValue:].

    Declaration

    Objective-C

    - (instancetype _Nullable)initWithValue:(unsigned short)major;

    Swift

    init?(value major: UInt16)

    Parameters

    major

    iBeacon Major value.

    Return Value

    Initialized object. Nil if validation fails.

  • Returns current value of iBeacon major setting.

    Declaration

    Objective-C

    - (unsigned short)getValue;

    Swift

    func getValue() -> UInt16

    Return Value

    iBeacon major value.

  • Method allows to read value of initialized iBeacon Major setting object.

    Declaration

    Objective-C

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

    Swift

    func readValue(completion: @escaping ESTSettingIBeaconMajorCompletionBlock)

    Parameters

    completion

    Block should be invoked when operation is complete.

    Return Value

    Initialized operation object.

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

    Declaration

    Objective-C

    - (void)writeValue:(unsigned short)value
            completion:(nonnull ESTSettingIBeaconMajorCompletionBlock)completion;

    Swift

    func writeValue(_ value: UInt16, completion: @escaping ESTSettingIBeaconMajorCompletionBlock)

    Parameters

    completion

    Block should 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)major;

    Swift

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

    Parameters

    major

    Major value.

    Return Value

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