Mac Developer Library

Developer

Quartz Framework Reference IKCameraDeviceViewDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

IKCameraDeviceViewDelegate

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.6 and later.

The IKCameraDeviceViewDelegate protocol is adopted by the delegate of the IKCameraDeviceView class. It allows downloading of camera content, handling selection changes, and handling errors.

  • Invoked for each file that is downloaded from the camera device.

    Declaration

    Swift

    optional func cameraDeviceView(_ cameraDeviceView: IKCameraDeviceView!, didDownloadFile file: ICCameraFile!, location url: NSURL!, fileData data: NSData!, error error: NSError!)

    Objective-C

    - (void)cameraDeviceView:(IKCameraDeviceView *)cameraDeviceView didDownloadFile:(ICCameraFile *)file location:(NSURL *)url fileData:(NSData *)data error:(NSError *)error

    Parameters

    cameraDeviceView

    The camera device view that sent the message.

    file

    The camera file.

    url

    The URL to save the data.

    data

    The data.

    error

    Any errors encountered during downloading.

    Discussion

    If the IKCameraDeviceView transferMode property is IKCameraDeviceViewTransferModeFileBased then camera file will have been saved to url. The URL will be a complete path to save the file, including a ‘sequence number’ if the file already exists.

    If the transferMode is IKCameraDeviceViewTransferModeMemoryBased then the data parameter contains the image data and can be handled as appropriate for your application.

    In case of an error, the passed data (both url and data) will be NULL and error (which may come directly from the camera module / or the ImageCaptureCore framework) will describe why the download or save failed.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Invoked when the selection changed.

    Declaration

    Swift

    optional func cameraDeviceViewSelectionDidChange(_ cameraDeviceView: IKCameraDeviceView!)

    Objective-C

    - (void)cameraDeviceViewSelectionDidChange:(IKCameraDeviceView *)cameraDeviceView

    Parameters

    cameraDeviceView

    The camera device view that sent the message.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Invoked when the camera encounters an error.

    Declaration

    Swift

    optional func cameraDeviceView(_ cameraDeviceView: IKCameraDeviceView!, didEncounterError error: NSError!)

    Objective-C

    - (void)cameraDeviceView:(IKCameraDeviceView *)cameraDeviceView didEncounterError:(NSError *)error

    Parameters

    cameraDeviceView

    The camera device view that sent the message.

    error

    The error.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.