Swiftpack.co -  Package - BinaryBirds/hook-kit
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
BinaryBirds/hook-kit
Generic event hook functions and invocation for Swift.
.package(url: "https://github.com/BinaryBirds/hook-kit.git", from: "1.0.0")

HookKit

Generic event hook functions and invocation for Swift.

Install

Add the repository as a dependency:

.package(url: "https://github.com/binarybirds/hook-kit", from: "1.0.0"),

Add HookKit to the target dependencies:

.product(name: "HookKit", package: "hook-kit"),

Update the packages and you are ready to use HookKit.

Basic usage

let hooks = HookStorage()
hooks.register("test") { _ in "Hello world" }
let result: String? = hooks.invoke("test")
print(result) /// Optional("Hello world")

To learn more about hook functions, please read my article.

GitHub

link
Stars: 2
Last commit: 4 weeks ago

Release Notes

Initial release
4 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco