SwiftHooks is a little module for plugins, in Swift

Overview
SwiftHooks Logo

SwiftHooks is a little module for plugins, in Swift


Auto Release CircleCI Cocoapods Cocoapods platforms License GitHub top language GitHub Pages

A Hook represents a "pluggable" point in a software model. They provide a mechanism for "tapping" into such points to get updates, or apply additional functionality to some typed object.

Variety of built in hook types

Type Behavior
Basic Executes the taps with no return value
Waterfall "Reduce" the result through all the taps
Bail Retrieve the result of the first tap that handles the calling value
Loop Execute taps until no taps request the loop be restarted

Visit our site for information about how to use SwiftHooks.

Inspiration

At Intuit, we're big fans of tapable, and plugin architecture. This package is the Swift companion to the Kotlin hooks. These are packages we use to enable extensible software, keeping extensions isolated to those that need them, avoiding bloat in primary projects.

Installation

Swift Package Manager

Install with Swift Package Manager by adding a reference to your Package.swift dependencies:

let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/intuit/swift-hooks.git", from: "0.0.1")
    ]
)

CocoaPods

Install with CocoaPods by adding an entry to your Podfile, and then running pod install:

pod 'SwiftHooks'

Structure

Contributing

Feel free to make an issue if you are having trouble or open a pull request if you have an improvement to add!

Make sure to read our code of conduct.

Build

This is a Swift only package, so it can be built easily from the command line:

swift build

Test

Running tests in parallel is preffered as it completes much faster:

swift test --parallel

Lint

This project uses SwiftLint for linting, and follows the default conventions:

swift run swiftlint

Formatting

This project is also set up for SwiftFormat to automatically format code:

swift run swiftformat Sources
Comments
  • reduce resource_class for circle

    reduce resource_class for circle

    What Changed

    Reduced resource class to small instead of the default large

    Why

    No need for a large, builds are short anyway

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes
    skip-release 
    opened by hborawski 2
  • Add support for untapping hooks

    Add support for untapping hooks

    What Changed

    Adds an untap(_:) method to hooks, and has all tap methods return an ID that can be used to untap.

    Why

    To prevent memory leaks, or just allow the ability for deregistering under certain circumstances may be necessary

    Todo:

    • [x] Add tests
    • [x] Add docs
    • [x] Add release notes

    Release Notes

    Adds an untap(_:) method to hooks, and has all tap methods return an ID that can be used to untap.

    ๐Ÿ“ฆ Published PR as canary version: 0.1.0--canary.10.85

    minor released 
    opened by hborawski 2
  • add badge to show platform support

    add badge to show platform support

    What Changed

    Added related badge for platform support

    Why

    To make it easily discernible that this package works on all platforms

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes
    documentation skip-release released 
    opened by hborawski 1
  • Enable tvOS and watchOS support in Package

    Enable tvOS and watchOS support in Package

    What Changed

    Enable tvOS and watchOS support for Package.swift Enable macOS, tvOS and watchOS in podspec

    Why

    Works on all platforms

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes

    ๐Ÿ“ฆ Published PR as canary version: 0.0.6--canary.6.62

    patch released 
    opened by hborawski 1
  • add doc link to readme

    add doc link to readme

    What Changed

    Add link to doc site to readme

    Why

    DocC doesn't work directly from the pages main entry, it needs a path

    Todo:

    • [ ] Add tests
    • [x] Add docs
    • [ ] Add release notes
    documentation skip-release released 
    opened by hborawski 1
  • set base path for docs to work with github pages

    set base path for docs to work with github pages

    What Changed

    Moved --hosting-base-path to the process-archive command

    Why

    The documentation on how to use DocC is not clear on how to generate docs for static hosting, this should resolve the resource problem

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes

    Release Notes

    ๐Ÿ“ฆ Published PR as canary version: 0.0.5--canary.4.44

    patch released 
    opened by hborawski 1
  • use workspace to persist doc archive to release job

    use workspace to persist doc archive to release job

    What Changed

    Added workspace persistence to share built .doccarchive to release job

    Why

    Otherwise it doesn't exist to push to gh-pages

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes

    ๐Ÿ“ฆ Published PR as canary version: 0.0.4--canary.3.38

    patch released 
    opened by hborawski 1
  • add an additional exclusion for files

    add an additional exclusion for files

    What Changed

    • Exclude .swiftdoc files from the pod
    • Exclude Documentation.docc from the SPM target

    Why

    • Consumption through bazel and the cocoapods-bazel was failing to copy a swiftdoc file in Xcode 13.3+

    Todo:

    • [ ] Add tests
    • [ ] Add docs
    • [ ] Add release notes

    Release Notes

    ๐Ÿ“ฆ Published PR as canary version: 0.1.1--canary.12.95

    patch 
    opened by hborawski 1
Releases(0.1.0)
Owner
Intuit
Powering prosperity around the world.
Intuit
Network debugging made easy๏ผŒThis network debugging tool is developed based on the swift version of Wormholy.

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

null 21 Dec 14, 2022
A swift network profiler built on top of URLSession.

By Xmartlabs SRL. Introduction Xniffer is a non-intrusive framework for intercepting outgoing requests and their responses between your app and any ex

xmartlabs 498 Dec 24, 2022
Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened his eyes

GodEye Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened hi

้™ˆๅฅ•้พ™(ๅญๅพช) 3.7k Dec 23, 2022
LOL Champions app: a small Multi-Module demo application to demonstrate modern iOS application tech-stacks with a Multi-module and MVVM architecture

LOL Champions app: a small Multi-Module demo application to demonstrate modern iOS application tech-stacks with a Multi-module and MVVM architecture

Ahmed Nasser 5 Jun 9, 2022
A library for creating Stream Deck plugins in Swift.

StreamDeck A library for creating Stream Deck plugins in Swift. Usage Your plugin class should inherit from StreamDeckPlugin, which handles the WebSoc

Emory Dunn 15 Jan 2, 2023
A collection of Swift Package Manager plugins.

KipplePlugins A collection of Swift Package Manager plugins. โš ๏ธ The code in this library has been made public as-is for the purposes of education, dis

Kipple 10 Oct 10, 2022
The template for Delta Client plugins.

Delta Plugin Template This repository is a template for Delta Client plugins. To create a plugin, create a repo from this template repo and then repla

null 1 Jan 12, 2022
A repository of example plugins for Delta Client

Example Plugins for Delta Client This repository contains a few example plugins to help developers get a practical understanding of how to use the plu

null 0 Oct 30, 2021
XTextHandler - Xcode Source Editor Extension Tools (Xcode 8 Plugins)

Download Let's Swift! xTextHandler has been rewritten in Swift. The Objective-C version can be found in: https://github.com/cyanzhong/xTextHandler-obj

Ying Zhong (Inactive) 1.5k Sep 7, 2022
๐Ÿงš RxSwift + Moya + HandyJSON + Plugins.

RxNetworks ?? . RxSwift + Moya + HandyJSON + Plugins. ?? ?? ?? English | ็ฎ€ไฝ“ไธญๆ–‡ This is a set of infrastructure based on RxSwift + Moya MoyaNetwork This

77ใ€‚ 140 Jan 3, 2023
:octocat: AdaptiveController is a 'Progressive Reduction' Swift UI module for adding custom states to Native or Custom iOS UI elements. Swift UI component by @Ramotion

ADAPTIVE TAB BAR 'Progressive Reduction' module for adding custom states to Native or Custom UI elements. We specialize in the designing and coding of

Ramotion 2k Nov 9, 2022
Swift tool to generate Module Interfaces for Swift projects.

ModuleInterface Swift tool to generate Module Interfaces for Swift projects. What is a Module Interface A Module Interface is what we commonly get usi

Jorge Revuelta 75 Dec 21, 2022
Swift Modules, a swift module (or package) manager

Swift Modules The Swift Modules manager similar to the JavaScript world's npm and bower

Jan Kuฤa 60 Jun 3, 2021
Swift-VIPER-Module - Xcode template for VIPER Architecture written in Swift 4

โš ๏ธ Deprecated โš ๏ธ This library is deprecated. When you decide to use VIPER architecture in your project, it is very tired create new modules, because y

Juanpe Catalรกn 533 Nov 17, 2022
Easily integrate Credit Card payments module in iOS App. Swift 4.0

MFCard Buy me a coffee MFCard is an awesome looking Credit Card input & validation control. Written in Swift 3. YOoo, Now MFCard is on Swift 5. Swift

MobileFirst 362 Nov 29, 2022
A Swift material design UI module which paints over the parent view when the switch is on.

A Swift material design UI module which paints over the parent view when the switch is on. We specialize in the designing and coding of c

Ramotion 2.9k Dec 29, 2022
RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

ANIMATED TAB BAR Swift UI module library for adding animation to iOS tabbar items and icons.

Ramotion 11k Jan 8, 2023
A Swift 4.2 VIPER Module Boilerplate Generator with predefined functions and a BaseViewProtocol.

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. Are you new to VIPER Design Pattern? Want

Mohamad Kaakati 68 Sep 29, 2022
A Swift material design UI module which paints over the parent view when the switch is on.

:octocat: ?? RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion

Ramotion 2.9k Dec 29, 2022
A Swift Popup Module help you popup your custom view easily

JFPopup JFPopup is a Swift Module help you popup your custom view easily. Support 3 way to popup, Drawer, Dialog and BottomSheet. Example To run the e

้€ธ้ฃŽ 77 Dec 14, 2022