addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. void userNotificationCenter_didDeliverNotification_(
    1. NSUserNotificationCenter,
    2. NSUserNotification
    )?,
  3. void userNotificationCenter_didActivateNotification_(
    1. NSUserNotificationCenter,
    2. NSUserNotification
    )?,
  4. bool userNotificationCenter_shouldPresentNotification_(
    1. NSUserNotificationCenter,
    2. NSUserNotification
    )?,
  5. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSUserNotificationCenterDelegate protocol to an existing objc.ObjCProtocolBuilder. All methods that can be implemented as blocking listeners will be.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilderAsBlocking(
  objc.ObjCProtocolBuilder builder, {
  void Function(NSUserNotificationCenter, NSUserNotification)?
  userNotificationCenter_didDeliverNotification_,
  void Function(NSUserNotificationCenter, NSUserNotification)?
  userNotificationCenter_didActivateNotification_,
  bool Function(NSUserNotificationCenter, NSUserNotification)?
  userNotificationCenter_shouldPresentNotification_,
  bool $keepIsolateAlive = true,
}) {
  NSUserNotificationCenterDelegate
      .userNotificationCenter_didDeliverNotification_
      .implementAsBlocking(
        builder,
        userNotificationCenter_didDeliverNotification_,
      );
  NSUserNotificationCenterDelegate
      .userNotificationCenter_didActivateNotification_
      .implementAsBlocking(
        builder,
        userNotificationCenter_didActivateNotification_,
      );
  NSUserNotificationCenterDelegate
      .userNotificationCenter_shouldPresentNotification_
      .implement(builder, userNotificationCenter_shouldPresentNotification_);
  builder.addProtocol($protocol);
}