implement static method

NSMutableCopying implement({
  1. required ObjCObject mutableCopyWithZone_(
    1. Pointer<NSZone>
    ),
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSMutableCopying 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 NSMutableCopying implement({
  required objc.ObjCObject Function(ffi.Pointer<NSZone>) mutableCopyWithZone_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSMutableCopying');
  NSMutableCopying$Builder.mutableCopyWithZone_.implement(
    builder,
    mutableCopyWithZone_,
  );
  builder.addProtocol($protocol);
  return NSMutableCopying.as(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}