B9MulticastDelegate

master

MulticastDelegate in a satisfied implementation.
b9swift/MulticastDelegate

B9 MulticastDelegate

Swift Version Swift Package Manager Build Status Codecov

Multicast delegate is a delegate that can have more than one element in its invocation list.

Installation

Using Swift Package Manager or import manually.

Features

  • NSHashTable free. It results better performance, support Liunx.
  • MulticastDelegate confirms Sequence, which means that lots of sequence features available.
  • Other delightful details, eg: error handling optimization, debug log optimization.

Background

I'm a big fan of the multicast delegate. I have "invented" and used it since 2014.

As Swift’s ABI is stabilized, it's time to move a Swift improvment.

But I cannot find a satisfied implementation everywhere. So I write one.

Alternatives

  • jonasman/MulticastDelegate - Use NSHashTable. Operator overloading is not a good idea in my opinion, it is not intuitive and reduces readability. API does not meet design guidelines (Omit needless words).
  • elano50/MulticastDelegateKit - Use NSHashTable.
  • Kevin Lundberg's - Generic type should not be AnyObject. API does not meet design guidelines (Omit needless words).
  • Greg Read's - Missing dupracate check when adding. API does not meet design guidelines (Omit needless words). I dislike remove when invoking.
  • Ivan's - Missing dupracate check when adding. It is odd using an equatable weak wrapper to check duplicates.

Description

  • Swift Tools 5.0.0

Dependencies

  • None
Last updated: Thu Jul 08 2021 17:51:53 GMT-0500 (GMT-05:00)