implementAsBlocking static method

NSSoundDelegate implementAsBlocking({
  1. void sound_didFinishPlaying_(
    1. NSSound,
    2. bool
    )?,
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSSoundDelegate protocol. To implement multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All methods that can be implemented as blocking listeners will be.

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

Implementation

static NSSoundDelegate implementAsBlocking({
  void Function(NSSound, bool)? sound_didFinishPlaying_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSSoundDelegate');
  NSSoundDelegate.sound_didFinishPlaying_.implementAsBlocking(
    builder,
    sound_didFinishPlaying_,
  );
  builder.addProtocol($protocol);
  return NSSoundDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}