implement static method

NSViewContentSelectionInfo implement({
  1. NSRect selectionAnchorRect()?,
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSViewContentSelectionInfo 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 NSViewContentSelectionInfo implement({
  NSRect Function()? selectionAnchorRect,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSViewContentSelectionInfo',
  );
  NSViewContentSelectionInfo.selectionAnchorRect.implement(
    builder,
    selectionAnchorRect,
  );
  builder.addProtocol($protocol);
  return NSViewContentSelectionInfo.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}