Latest 0.1.1
Homepage https://github.com/clmntcrl/subscription
License MIT
Platforms ios 10.0, osx 10.10, tvos 10.0
Frameworks XCTest
Authors

Type-safe subscription to NotificationCenter with self unsubscription.

Usage

let valueDidChange = Subscription<String>(name: "valueDidChangeNotification")

var value: String = "ok" {
    didSet { valueDidChange.next(value) }
}

let subscriptionToken = valueDidChange.subscribe { print($0) }
value += "!" // print: "ok!"

For more details, feel free to take a look at Subscription.playground.

Installation

Carthage

Add the following dependency to your Cartfile:

github "clmntcrl/subscription" ~> 0.1

CocoaPods

Add the following pod to your Podfile:

pod 'Subscription', '~> 0.1'

SwiftPM

Add the package as dependency in your Package.swift:

dependencies: [
    .package(url: "https://github.com/clmntcrl/swidux-subscription.git", from: "0.1.1"),
]

License

Subscription is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "Subscription",
    "version": "0.1.1",
    "summary": "Type-safe subscription to NotificationCenter with self unsubscription.",
    "homepage": "https://github.com/clmntcrl/subscription",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Clu00e9ment Cyril": "[email protected]"
    },
    "social_media_url": "http://twitter.com/clmntcrl",
    "swift_version": "4.2",
    "platforms": {
        "ios": "10.0",
        "osx": "10.10",
        "tvos": "10.0"
    },
    "source": {
        "git": "https://github.com/clmntcrl/subscription.git",
        "tag": "0.1.1"
    },
    "frameworks": "XCTest",
    "source_files": [
        "Sources",
        "Sources/**/*.swift"
    ]
}

Pin It on Pinterest

Share This