implement static method

NSPasteboardReading implement({
  1. ObjCObjectBase? initWithPasteboardPropertyList_ofType_(
    1. ObjCObjectBase,
    2. DartNSPasteboardType
    )?,
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSPasteboardReading protocol. To implement multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.

If $keepIsolateAlive is true, this protocol will keep this isolate alive until it is garbage collected by both Dart and ObjC.

Implementation

static NSPasteboardReading implement({
  objc.ObjCObjectBase? Function(objc.ObjCObjectBase, DartNSPasteboardType)?
  initWithPasteboardPropertyList_ofType_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSPasteboardReading');
  NSPasteboardReading.initWithPasteboardPropertyList_ofType_.implement(
    builder,
    initWithPasteboardPropertyList_ofType_,
  );
  builder.addProtocol($protocol);
  return NSPasteboardReading.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}