Type Definitions
The following type definitions are available globally.
-
The block callback signature when the camera requests authentication.
Declaration
Objective-C
typedef void (^CBLCameraAuthenticationRequestBlock)( id<CBLCameraAuthenticationContext> _Nonnull)Swift
typealias CameraAuthenticationRequestBlock = (any CameraAuthenticationContext) -> VoidParameters
contextThe authentication context object for inspecting the request and delivering a response.
-
The block callback signature when a camera’s authentication request has been resolved and authentication UI can be hidden.
Declaration
Objective-C
typedef void (^CBLCameraAuthenticationResolvedBlock)(void)Swift
typealias CameraAuthenticationResolvedBlock = () -> Void -
The block callback signature when camera connection completes or fails.
Declaration
Objective-C
typedef void (^CBLCameraConnectionCompleteBlock)( NSError *_Nullable, NSArray<id<CBLCameraConnectionWarning>> *_Nullable)Swift
typealias ConnectionCompleteCallback = ((any Error)?, [any ConnectionWarning]?) -> VoidParameters
errorThe error that occurred, if any.
warningsAny non-fatal connection warnings.
-
The block callback signature when a camera has a new camera-initiated transfer request. See
CBLCameraInitiatedTransferRequestfor details.Declaration
Objective-C
typedef void (^CBLCameraInitiatedTransferRequestHandler)( id<CBLCameraInitiatedTransferRequest> _Nonnull)Swift
typealias CameraInitiatedTransferRequestHandler = (any CameraInitiatedTransferRequest) -> Void -
An observer token. Required to unregister an oberver.
Declaration
Objective-C
typedef NSString CBLCameraObserverToken
-
The live view frame delivery callback.
Declaration
Objective-C
typedef void (^CBLCameraLiveViewFrameDelivery)( id<CBLCameraLiveViewFrame> _Nonnull, dispatch_block_t _Nonnull)Swift
typealias LiveViewFrameDelivery = (any LiveViewFrame, @escaping () -> Void) -> VoidParameters
frameA live view frame from the camera.
completionHandlerA completion handler to inform the camera that you’re ready for the next frame. This MUST be called, and can be called from any thread.
-
The handler for the live view stream ending.
Declaration
Objective-C
typedef void (^CBLCameraLiveViewTerminationHandler)( CBLCameraLiveViewTerminationReason, NSError *_Nullable)Swift
typealias LiveViewTerminationHandler = (LiveViewTerminationReason, (any Error)?) -> VoidParameters
reasonThe reason the live view stream ended.
errorThe error that caused the failure, if
reasonisCBLCameraLiveViewTerminationReasonFailed. -
The block callback signature when the discovery object changes the list of available cameras.
-
The block callback signature when a service has completed or failed resolving.
Declaration
Objective-C
typedef void (^CBLCameraDiscoveryServiceResolveCallback)( id<CBLCameraDiscoveryService> _Nonnull, NSError *_Nullable)Swift
typealias CameraDiscoveryServiceResolveCallback = (any CameraDiscoveryService, (any Error)?) -> VoidParameters
serviceThe service that completed or failed resolving.
errorIf the operation failed, an error object describing the operation.
-
The block callback signature when a service has completed or failed resolving metadata.
Declaration
Objective-C
typedef void (^CBLCameraDiscoveryMetadataResolveCallback)( id<CBLCameraDiscoveryService> _Nonnull, NSError *_Nullable)Swift
typealias CameraDiscoveryMetadataResolveCallback = (any CameraDiscoveryService, (any Error)?) -> VoidParameters
serviceThe service that completed or failed resolving.
errorIf the operation failed, an error object describing the operation.
-
The block callback signature for handling the result of a request to execute a camera-initiated transfer, containing either the result of the transfer, or an error describing the failure.
Declaration
Objective-C
typedef void (^CBLCameraInitiatedTransferCompletionHandler)( id<CBLCameraInitiatedTransferResult> _Nullable, NSError *_Nullable)Swift
typealias CameraInitiatedTransferCompletionHandler = ((any CameraInitiatedTransferResult)?, (any Error)?) -> Void -
The callback block signature that is called when a manual camera lookup succeeds or fails.
Declaration
Objective-C
typedef void (^CBLCameraCreationOperationCallback)(id<CBLCamera> _Nullable, NSError *_Nullable)Swift
typealias CameraCreationOperationCallback = ((any CBLCamera)?, (any Error)?) -> VoidParameters
cameraThe camera that was created, if the operation was successful.
errorAn error, if the operation failed.
-
A property common value. Values will be from one of the appropriate common value enums as defined below.
Declaration
Objective-C
typedef NSInteger CBLPropertyCommonValueSwift
typealias PropertyCommonValue = Int -
The block callback signature for property observations.
Declaration
Objective-C
typedef void (^CBLCameraPropertyObservationCallback)( id<CBLCameraProperty> _Nonnull, CBLPropertyChangeType)Swift
typealias CameraPropertyObservationCallback = (any CameraProperty, PropertyChangeType) -> VoidParameters
propertyThe property that fired the change.
typeThe change type(s) that occurred. See
CBLPropertyChangeTypefor details. -
The block callback signature for an async operation that can fail with an error.
Declaration
Objective-C
typedef void (^CBLErrorableOperationCallback)(NSError *_Nullable)Swift
typealias ErrorableOperationCallback = ((any Error)?) -> VoidParameters
errorThe error that occurred, if any. If
nil, the operation succeeded. -
A value representing a camera family, usually grouped by camera manufacturer.
Declaration
Objective-C
typedef NSInteger CBLCameraFamilySwift
typealias CameraFamily = Int -
A filesystem observation block.
Declaration
Objective-C
typedef void (^CBLFileStorageFilesModifiedObserver)( id<CBLFileStorage> _Nonnull, id<CBLFileSystemFolderItem> _Nullable, CBLFileSystemModificationOperation, NSArray<id<CBLFileSystemItem>> *_Nullable)Swift
typealias FileStorageFilesModifiedObserver = (any FileStorage, (any FileSystemFolderItem)?, FileSystemModificationOperation, [any CBLFileSystemItem]?) -> VoidParameters
storageThe filesystem storage instance that the change occurred on.
modifiedFolderThe folder in which the change occurred.
operationThe operation that occurred.
affectedItemsThe items that were added or removed.
-
A filesystem observer token. Required to unregister an oberver.
Declaration
Objective-C
typedef NSString CBLFileStorageObserverToken -
The callback block preflight signature for fetching image previews. This will be called just before an image preview is about to be fetched.
This can be useful when implementing (example) a scrolling list of thumbnails — if the user is scrolling quickly, you can cancel requests for thumbnails that are no longer onscreen.
Declaration
Objective-C
typedef BOOL (^CBLPreviewImagePreflight)(id<CBLFileSystemItem> _Nonnull)Swift
typealias PreviewImagePreflight = (any FileSystemItem) -> BoolParameters
itemThe filesystem item the preview will be fetched for.
Return Value
Return
YESto continue to fetch the preview, otherwiseNOto cancel. -
The callback block signature for a completed or failed image previews.
Declaration
Objective-C
typedef void (^CBLPreviewImageDelivery)(id<CBLFileSystemItem> _Nonnull, NSError *_Nullable, NSData *_Nullable)Swift
typealias PreviewImageDelivery = (any FileSystemItem, (any Error)?, Data?) -> VoidParameters
itemThe filesystem item the preview is for.
errorIf the operation failed, an error object that describes the failure.
imageDataIf the operation succeeded, JPEG data for the preview.
-
The callback block preflight signature for fetching image EXIF metadata. This will be called just before the metadata is about to be fetched.
This can be useful when implementing (example) a scrolling list of images — if the user is scrolling quickly, you can cancel metadata requests for images that are no longer onscreen.
Declaration
Objective-C
typedef BOOL (^CBLEXIFPreflight)(id<CBLFileSystemItem> _Nonnull)Swift
typealias EXIFPreflight = (any FileSystemItem) -> BoolParameters
itemThe filesystem item the metadata will be fetched for.
Return Value
Return
YESto continue to fetch the metadata, otherwiseNOto cancel. -
The callback block signature for a completed or failed image metadata requests.
Declaration
Objective-C
typedef void (^CBLEXIFDelivery)(id<CBLFileSystemItem> _Nonnull, NSError *_Nullable, NSDictionary<NSString *, id> *_Nullable)Swift
typealias EXIFDelivery = (any FileSystemItem, (any Error)?, [String : Any]?) -> VoidParameters
itemThe filesystem item the metadata is for.
errorIf the operation failed, an error object that describes the failure.
imageMetadataIf the operation succeeded, ImageIO-compatible metadata.
-
The callback block preflight signature for fetching video metadata. This will be called just before the metadata is about to be fetched.
This can be useful when implementing (example) a scrolling list of thumbnails — if the user is scrolling quickly, you can cancel metadata requests for images that are no longer onscreen.
Declaration
Objective-C
typedef BOOL (^CBLVideoMetadataPreflight)(id<CBLFileSystemItem> _Nonnull)Swift
typealias VideoMetadataPreflight = (any FileSystemItem) -> BoolParameters
itemThe filesystem item the metadata will be fetched for.
Return Value
Return
YESto continue to fetch the metadata, otherwiseNOto cancel. -
The callback block signature for a completed or failed video metadata requests.
Declaration
Objective-C
typedef void (^CBLVideoMetadataDelivery)(id<CBLFileSystemItem> _Nonnull, NSError *_Nullable, id<CBLVideoMetadata> _Nullable)Swift
typealias VideoMetadataDelivery = (any FileSystemItem, (any Error)?, (any VideoMetadata)?) -> VoidParameters
itemThe filesystem item the metadata is for.
errorIf the operation failed, an error object that describes the failure.
videoMetadataIf the operation succeeded, the metadata.
-
The callback block preflight signature for streaming files from the camera. This will be called just before the stream is about to begin.
Declaration
Objective-C
typedef id _Nullable (^CBLFileStreamPreflight)(id<CBLFileSystemItem> _Nonnull)Swift
typealias FileStreamPreflight = (any FileSystemItem) -> Any?Parameters
itemThe filesystem item that will be streamed.
Return Value
Return any object to use as a “context” for the operation, including
nil. This object will be passed to chunk delivery callbacks. For example, you may want to set up a file handle or data storage object here for chunks to be written to later. -
The callback block signature for data chunk delivery when streaming files from the camera. This will be called multiple times in sequence once an operation starts.
IMPORTANT: In some circumstances, this delivery block may be invoked with an empty/zero-length chunk of data. Make sure your code handles this case properly. Such a delivery should not be treated as an error, and you should return the desired instruction.
Declaration
Objective-C
typedef CBLFileStreamInstruction (^CBLFileStreamChunkDelivery)( id<CBLFileSystemItem> _Nonnull, NSData *_Nonnull, id _Nullable)Swift
typealias FileStreamChunkDelivery = (any FileSystemItem, Data, Any?) -> FileStreamInstructionParameters
itemThe filesystem item being streamed.
chunkThe chunk of file data delivered from the camera.
contextThe context object returned from the streaming preflight block.
Return Value
Return
CBLFileStreamInstructionContinueto continue the operation and get more chunks, orCBLFileStreamInstructionCancelto cancel the operation. -
The callback block signature that will be called when a file streaming operation completes for fails.
Declaration
Objective-C
typedef void (^CBLFileStreamCompletion)(id<CBLFileSystemItem> _Nonnull, NSError *_Nullable, id _Nullable)Swift
typealias FileStreamCompletion = (any FileSystemItem, (any Error)?, Any?) -> VoidParameters
itemThe filesystem item being streamed.
errorIf the operation failed (including being cancelled), an error describing the failure.
contextThe context object returned from the streaming preflight block.
-
The block callback signature when an attempt to connect to a WiFi network succeeds of fails.
Declaration
Objective-C
typedef void (^CBLHotspotCompletion)(id<CBLHotspotConfiguration> _Nullable, NSError *_Nullable)Swift
typealias HotspotCompletion = ((any HotspotConfiguration)?, (any Error)?) -> VoidParameters
configurationUpon success, contains an
id <CBLHotspotConfiguration>object containing information about the network.errorUpon failure, contains an error object detailing the error.
Type Definitions Reference