implement static method

NSSeguePerforming implement({
  1. void prepareForSegue_sender_(
    1. NSStoryboardSegue,
    2. ObjCObjectBase?
    )?,
  2. void performSegueWithIdentifier_sender_(
    1. DartNSStoryboardSegueIdentifier,
    2. ObjCObjectBase?
    )?,
  3. bool shouldPerformSegueWithIdentifier_sender_(
    1. DartNSStoryboardSegueIdentifier,
    2. ObjCObjectBase?
    )?,
  4. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSSeguePerforming 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 NSSeguePerforming implement({
  void Function(NSStoryboardSegue, objc.ObjCObjectBase?)?
  prepareForSegue_sender_,
  void Function(DartNSStoryboardSegueIdentifier, objc.ObjCObjectBase?)?
  performSegueWithIdentifier_sender_,
  bool Function(DartNSStoryboardSegueIdentifier, objc.ObjCObjectBase?)?
  shouldPerformSegueWithIdentifier_sender_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSSeguePerforming');
  NSSeguePerforming.prepareForSegue_sender_.implement(
    builder,
    prepareForSegue_sender_,
  );
  NSSeguePerforming.performSegueWithIdentifier_sender_.implement(
    builder,
    performSegueWithIdentifier_sender_,
  );
  NSSeguePerforming.shouldPerformSegueWithIdentifier_sender_.implement(
    builder,
    shouldPerformSegueWithIdentifier_sender_,
  );
  builder.addProtocol($protocol);
  return NSSeguePerforming.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}