addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required void collectionView_prefetchItemsAtIndexPaths_(
    1. NSCollectionView,
    2. NSArray
    ),
  3. void collectionView_cancelPrefetchingForItemsAtIndexPaths_(
    1. NSCollectionView,
    2. NSArray
    )?,
  4. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSCollectionViewPrefetching protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  required void Function(NSCollectionView, objc.NSArray)
  collectionView_prefetchItemsAtIndexPaths_,
  void Function(NSCollectionView, objc.NSArray)?
  collectionView_cancelPrefetchingForItemsAtIndexPaths_,
  bool $keepIsolateAlive = true,
}) {
  NSCollectionViewPrefetching.collectionView_prefetchItemsAtIndexPaths_
      .implement(builder, collectionView_prefetchItemsAtIndexPaths_);
  NSCollectionViewPrefetching
      .collectionView_cancelPrefetchingForItemsAtIndexPaths_
      .implement(
        builder,
        collectionView_cancelPrefetchingForItemsAtIndexPaths_,
      );
  builder.addProtocol($protocol);
}