ESTSettingNearablePower
@interface ESTSettingNearablePower : ESTSettingReadWrite <NSCopying>
ESTSettingNearablePower represents Nearable Power value.
-
Designated initializer. Validates provided value internally with +validationErrorForValue:.
See
+[ESTSettingNearablePower validationErrorForValue:]
Declaration
Objective-C
- (nonnull instancetype)initWithValue:(ESTNearablePower)power;Swift
init(value power: ESTNearablePower)Parameters
powerNearable Power value.
Return Value
Initialized object. Nil if validation fails.
-
Returns current value of Nearable Power setting.
Return Value
Nearable Power value.
-
Method allows to read value of initialized Nearable Power setting object.
Declaration
Objective-C
- (void)readValueWithCompletion: (nonnull ESTSettingNearablePowerCompletionBlock)completion;Swift
func readValue(completion: @escaping ESTSettingNearablePowerCompletionBlock)Parameters
completionBlock to be invoked when operation is complete.
-
Method allows to create write operation from already initialized Nearable Power setting object. Value provided during initialization will be used as a desired value.
Declaration
Objective-C
- (void)writeValue:(ESTNearablePower)power completion:(nonnull ESTSettingNearablePowerCompletionBlock)completion;Swift
func writeValue(_ power: ESTNearablePower, completion: @escaping ESTSettingNearablePowerCompletionBlock)Parameters
powerPower value to be written to the device.
completionBlock to be invoked when operation is complete.
-
Method checks if provided value is allowed. Returns nil if validation passes.
Declaration
Objective-C
+ (NSError *_Nullable)validationErrorForValue:(ESTNearablePower)Power;Swift
class func validationError(forValue Power: ESTNearablePower) -> Error?Parameters
PowerPower value.
Return Value
Error object describing why validation failed. Nil if validation passes.
View on GitHub
ESTSettingNearablePower Class Reference