implement static method

NSTextContentManagerDelegate implement({
  1. NSTextElement? textContentManager_textElementAtLocation_(
    1. NSTextContentManager,
    2. NSTextLocation
    )?,
  2. bool textContentManager_shouldEnumerateTextElement_options_(
    1. NSTextContentManager,
    2. NSTextElement,
    3. NSTextContentManagerEnumerationOptions
    )?,
  3. bool $keepIsolateAlive = true,
})

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