Mac Developer Library

Developer

Quartz Framework Reference IKScannerDeviceViewDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

IKScannerDeviceViewDelegate

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 IKScannerDeviceViewDelegate protocol defines the delegate protocol that the IKScannerDeviceView delegate must conform to.

  • Invoked when the scan has completed and the data is available.

    Declaration

    Swift

    optional func scannerDeviceView(_ scannerDeviceView: IKScannerDeviceView!, didScanToURL url: NSURL!, fileData data: NSData!, error error: NSError!)

    Objective-C

    - (void)scannerDeviceView:(IKScannerDeviceView *)scannerDeviceView didScanToURL:(NSURL *)url fileData:(NSData *)data error:(NSError *)error

    Parameters

    scannerDeviceView

    The scanner device that sent the message.

    url

    The URL to save the data.

    data

    The data from the scan.

    error

    Any error encountered during the scan.

    Discussion

    This method is called when the scan has completed..

    If the scannerDeviceView transferMode is IKScannerDeviceViewTransferModeFileBased, the scan will have been saved at the specified url. The URL will be in the download directory and be a complete path, including a ‘sequence number’ if the file already exists.

    If the scannerDeviceViewtransferMode is IKScannerDeviceViewTransferModeMemoryBased, the scanned data is contained in the data parameter. You can then take the action appropriate to your application.

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

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.6 and later.

  • Invoked whenever the scanner encounters an error.

    Declaration

    Swift

    optional func scannerDeviceView(_ scannerDeviceView: IKScannerDeviceView!, didEncounterError error: NSError!)

    Objective-C

    - (void)scannerDeviceView:(IKScannerDeviceView *)scannerDeviceView didEncounterError:(NSError *)error

    Parameters

    scannerDeviceView

    The scanner device 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.