CBLCameraProperty

Objective-C

@protocol CBLCameraProperty <NSObject>

Swift

protocol CameraProperty : NSObjectProtocol

An object representing the values for a property on the camera.

  • The property’s category.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CBLPropertyCategory category;

    Swift

    var category: PropertyCategory { get }
  • The property’s identifier.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CBLPropertyIdentifier identifier;

    Swift

    var identifier: PropertyIdentifier { get }
  • The camera from which the property is from.

    Declaration

    Objective-C

    @property (nonatomic, weak, readonly, nullable) id<CBLCamera> camera;

    Swift

    weak var camera: CBLCamera? { get }
  • The property’s display name.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSString *localizedDisplayName;

    Swift

    var localizedDisplayName: String? { get }
  • Returns the property’s set type. Observable with key-value observing.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CBLPropertyValueSetType valueSetType;

    Swift

    var valueSetType: PropertyValueSetType { get }
  • The current value of the property. Observable with key-value observing.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) id<CBLPropertyValue> currentValue;

    Swift

    var currentValue: PropertyValue? { get }
  • Add an observer to the property.

    The observer callback will be called on the main thread when either the currentValue or validSettableValues properties change. If possible, these changes will be consolidated into one callback rather than two.

    The returned observation object is not retained by the receiver, and the observation will be invalidated when the object is deallocated. Make sure you store this token somewhere to keep the observation active.

    Declaration

    Objective-C

    - (id<CBLCameraPropertyObservation> _Nonnull)addObserver:
        (CBLCameraPropertyObservationCallback _Nonnull)observerCallback;

    Swift

    func addObserver(_ observerCallback: @escaping CameraPropertyObservationCallback) -> CameraPropertyObservation

    Parameters

    observerCallback

    The observer block to be triggered, on the main thread, when changes occur.

    Return Value

    Returns an object to manage the lifecycle of the observation.

  • Remove a previously-registered observer from this property. Equivalent to calling -invalidate on the observer object.

    Declaration

    Objective-C

    - (void)removeObserver:(id<CBLCameraPropertyObservation> _Nonnull)observer;

    Swift

    func removeObserver(_ observer: CameraPropertyObservation)

    Parameters

    observer

    The observer to remove.

Property Setting: CBLPropertyValueSetTypeEnumeration

  • Returns the value currently in the process of being set, if any. Observable with key-value observing. Only valid if the property’s valueSetType is CBLPropertyValueSetTypeEnumeration.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) id<CBLPropertyValue> pendingValue;

    Swift

    var pendingValue: PropertyValue? { get }
  • The values that are considered valid for this property. Observable with key-value observing. Only valid if the property’s valueSetType is CBLPropertyValueSetTypeEnumeration.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSArray<id<CBLPropertyValue>> *validSettableValues;

    Swift

    var validSettableValues: [PropertyValue]? { get }
  • Attempt to find a valid settable value for the given common value.

    Declaration

    Objective-C

    - (id<CBLPropertyValue> _Nullable)validValueMatchingCommonValue:
        (CBLPropertyCommonValue)commonValue;

    Swift

    func validValue(matchingCommonValue commonValue: PropertyCommonValue) -> PropertyValue?

    Parameters

    commonValue

    The common value to find a value for. The intent must match the property identifier.

    Return Value

    Returns a valid settable value for the given intent, or nil if no value matches.

  • Attempt to set a new value for the property. The value must be in the validSettableValues property. As such, this method is only useable if the property’s valueSetType contains CBLPropertyValueSetTypeEnumeration.

    Declaration

    Objective-C

    - (void)setValue:(id<CBLPropertyValue> _Nonnull)newValue
          completionQueue:(dispatch_queue_t _Nonnull)queue
        completionHandler:(CBLErrorableOperationCallback _Nonnull)completionHandler;

    Swift

    func setValue(_ newValue: PropertyValue, completionQueue queue: dispatch_queue_t, completionHandler: Any!)

    Parameters

    newValue

    The value to set.

    queue

    The queue on which to call the completion handler.

    completionHandler

    The completion handler to call when the operation succeeds or fails.

  • Attempt to set a new value for the property. The value must be in the validSettableValues property. As such, this method is only useable if the property’s valueSetType contains CBLPropertyValueSetTypeEnumeration.

    Declaration

    Objective-C

    - (void)setValue:(id<CBLPropertyValue> _Nonnull)newValue
        completionHandler:(CBLErrorableOperationCallback _Nonnull)completionHandler;

    Swift

    func setValue(_ newValue: PropertyValue, completionHandler: Any!)

    Parameters

    newValue

    The value to set.

    completionHandler

    The completion handler to call on the main queue when the operation succeeds or fails.

Property Setting: CBLPropertyValueSetTypeStepping

  • Increment the property’s value by one step. Only useable if the property’s valueSetType contains CBLPropertyValueSetTypeStepping.

    Note

    If you’re constructing a UI in a left-to-right locale (such as English) like this, this method should be called when the user taps on the right arrow: [<] f/2.8 [>], or the down arrow: [↑] f/2.8 [↓]. In other words, this method is moving the value towards the end of a list of values.

    Declaration

    Objective-C

    - (void)incrementValue:
        (CBLErrorableOperationCallback _Nonnull)completionHandler;

    Swift

    func incrementValue(completionHandler: Any!)

    Parameters

    completionHandler

    The completion handler to call on the main queue when the operation succeeds or fails.

  • Increment the property’s value by one step. Only useable if the property’s valueSetType contains CBLPropertyValueSetTypeStepping.

    Note

    If you’re constructing a UI in a left-to-right locale (such as English) like this, this method should be called when the user taps on the right arrow: [<] f/2.8 [>], or the down arrow: [↑] f/2.8 [↓]. In other words, this method is moving the value towards the end of a list of values.

    Declaration

    Objective-C

    - (void)
        incrementValueWithCompletionQueue:(dispatch_queue_t _Nonnull)completionQueue
                        completionHandler:(CBLErrorableOperationCallback _Nonnull)
                                              completionHandler;

    Swift

    func incrementValue(completionQueue: dispatch_queue_t, completionHandler: Any!)

    Parameters

    completionQueue

    The queue on which to call the completion handler.

    completionHandler

    The completion handler to call when the operation succeeds or fails.

  • Decrement the property’s value by one step. Only useable if the property’s valueSetType contains CBLPropertyValueSetTypeStepping.

    Note

    If you’re constructing a UI in a left-to-right locale (such as English) like this, this method should be called when the user taps on the left arrow: [<] f/2.8 [>], or the up arrow: [↑] f/2.8 [↓]. In other words, this method is moving the value towards the beginning of a list of values.

    Declaration

    Objective-C

    - (void)decrementValue:
        (CBLErrorableOperationCallback _Nonnull)completionHandler;

    Swift

    func decrementValue(completionHandler: Any!)

    Parameters

    completionHandler

    The completion handler to call on the main queue when the operation succeeds or fails.

  • Decrement the property’s value by one step. Only useable if the property’s valueSetType contains CBLPropertyValueSetTypeStepping.

    Note

    If you’re constructing a UI in a left-to-right locale (such as English) like this, this method should be called when the user taps on the left arrow: [<] f/2.8 [>], or the up arrow: [↑] f/2.8 [↓]. In other words, this method is moving the value towards the beginning of a list of values.

    Declaration

    Objective-C

    - (void)
        decrementValueWithCompletionQueue:(dispatch_queue_t _Nonnull)completionQueue
                        completionHandler:(CBLErrorableOperationCallback _Nonnull)
                                              completionHandler;

    Swift

    func decrementValue(completionQueue: dispatch_queue_t, completionHandler: Any!)

    Parameters

    completionQueue

    The queue on which to call the completion handler.

    completionHandler

    The completion handler to call when the operation succeeds or fails.