1 Star 0 Fork 0

B9Swift / MulticastDelegate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

B9MulticastDelegate

Swift Version Swift Package Manager Build Status gitee 镜像 GitHub Source

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

Installation

Use Swift Package Manager or import manually.

你也可以使用 gitee 镜像

Features

  • NSHashTable free. It brings better performance and support for Linux.
  • MulticastDelegate confirms Sequence, which means that lots of sequence features are available.
  • Thread safe.
  • 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 implementation.

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 duplicate check when adding. API does not meet design guidelines (Omit needless words). I dislike removing when invoking.
  • Ivan's - Missing duplicate check when adding. It is odd to use an equatable weak wrapper to check duplicates.
MIT License Copyright © 2019-2021 BB9z Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

令自己满意的一个 MulticastDelegate 实现 展开 收起
取消

发行版 (2)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Swift
1
https://gitee.com/b9swift/MulticastDelegate.git
git@gitee.com:b9swift/MulticastDelegate.git
b9swift
MulticastDelegate
MulticastDelegate
master

搜索帮助