Mac Developer Library

Developer

Quartz Framework Reference IKImageBrowserDataSource Protocol Reference

Options
Deployment Target:

On This Page
Language:

IKImageBrowserDataSource

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.5 and later.

The IKImageBrowserDataSource informal protocol declares the methods that an instance of the IKImageBrowserView class uses to access the contents of its data source object.

  • Returns the number of records managed by the data source object.

    Declaration

    Swift

    func numberOfItemsInImageBrowser(_ aBrowser: IKImageBrowserView!) -> Int

    Objective-C

    - (NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *)aBrowser

    Parameters

    aBrowser

    An image browser view.

    Return Value

    The number of records managed by the image browser view.

    Discussion

    Your data source must implement this method. An IKImageView object uses this method to determine how many cells it should create and display.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns an object for the item in an image browser view that corresponds to the specified index.

    Declaration

    Swift

    func imageBrowser(_ aBrowser: IKImageBrowserView!, itemAtIndex index: Int) -> AnyObject!

    Objective-C

    - (id)imageBrowser:(IKImageBrowserView *)aBrowser itemAtIndex:(NSUInteger)index

    Parameters

    aBrowser

    An image browser view.

    index

    The index of the item you want to retrieve.

    Return Value

    An IKImageBrowserItem object.

    Discussion

    Your data source must implement this method. The returned object must implement the required methods of the IKImageBrowserItem protocol.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Signals that a remove operation should be applied to the specified items.

    Declaration

    Swift

    func imageBrowser(_ aBrowser: IKImageBrowserView!, removeItemsAtIndexes indexes: NSIndexSet!)

    Objective-C

    - (void)imageBrowser:(IKImageBrowserView *)aBrowser removeItemsAtIndexes:(NSIndexSet *)indexes

    Parameters

    aBrowser

    An image browser view.

    indexes

    The indexes of the items that should be removed.

    Discussion

    This method is optional. It is invoked by the image browser after Image Kit determines that a remove operation should be applied. In response, the data source should update itself by removing the specified items.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Signals that the specified items should be moved to the specified destination.

    Declaration

    Swift

    func imageBrowser(_ aBrowser: IKImageBrowserView!, moveItemsAtIndexes indexes: NSIndexSet!, toIndex destinationIndex: Int) -> Bool

    Objective-C

    - (BOOL)imageBrowser:(IKImageBrowserView *)aBrowser moveItemsAtIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)destinationIndex

    Parameters

    aBrowser

    An image browser view.

    indexes

    The indexes of the items that should be reordered.

    destinationIndex

    The starting index of the destination the items should be moved to.

    Return Value

    YEStrue if successful; NOfalse otherwise.

    Discussion

    This method is optional. It is invoked by the image browser view after Image Kit determines that a reordering operation should be applied. The data source should update itself by reordering its elements.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Signals that a drag should begin.

    Declaration

    Swift

    func imageBrowser(_ aBrowser: IKImageBrowserView!, writeItemsAtIndexes itemIndexes: NSIndexSet!, toPasteboard pasteboard: NSPasteboard!) -> Int

    Objective-C

    - (NSUInteger)imageBrowser:(IKImageBrowserView *)aBrowser writeItemsAtIndexes:(NSIndexSet *)itemIndexes toPasteboard:(NSPasteboard *)pasteboard

    Parameters

    aBrowser

    An image browser view.

    itemIndexes

    The indexes of the items that should be dragged.

    pasteboard

    The pasteboard to copy the items to.

    Return Value

    The number of items written to the pasteboard.

    Discussion

    This method is optional. It is invoked after Image Kit determines that a drag should begin, but before the drag has been started.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.