Contents

scrollToItems(at:scrollPosition:)

Scrolls the collection view contents until the specified items are visible.

Declaration

func scrollToItems(at indexPaths: Set<IndexPath>, scrollPosition: NSCollectionView.ScrollPosition)

Parameters

  • indexPaths:

    The index paths of the items. The layout attributes of these items define the bounding box that needs to be scrolled onscreen.

  • scrollPosition:

    The options for scrolling the bounding box of the specified items into view. You may combine one vertical and one horizontal scrolling option when calling this method. Specifying more than one option for either the vertical or horizontal directions raises an exception.

Discussion

To animate the scrolling operation, call this method on the collection view’s animator() proxy object instead.

See Also

Locating Items and Views