Swiftpack.co - Package - denissimon/SwiftEvents


SwiftEvents is a lightweight, pure-Swift library for implementing events in iOS, macOS, watchOS, tvOS and Linux. It has NotificationCenter (multiple subscribers to the event), Delegation (one subscriber to the event) and KVO (observing properties using the event) functionality in one simple, not verbose and type-safe API.

The purpose of SwiftEvents is to simplify and improve the communication between components in a modern Swift project.

In comparison with Cocoa mechanisms, SwiftEvents has the following features:

  • [x] Type-safety

  • [x] Built-in solution for preventing retain cycles (no need to specify [weak self]!), in order to always be protected from memory leaks

  • [x] Cancelable subscriptions: automatic removal of subscribers when they are deallocated, so you don't need to explicitly manage this

  • [ ] Thread-safety: subscribers can be registered on a different thread than notifications are sent on

  • [ ] Delayed and one-time sending notifications

  • [x] Ability to observe properties in any class or struct

  • [x] Easier to debug and test, since there is no dependency on UIKit



To install SwiftEvents using CocoaPods, add it to your Podfile:

pod 'SwiftEvents'

Swift Package Manager

To install SwiftEvents using the Swift Package Manager, add it to your Package.swift file:

dependencies: [
    .Package(url: "https://github.com/denissimon/SwiftEvents.git", majorVersion: 0)


Drag the Sources folder anywhere in your project.



Licensed under the MIT license


Stars: 1
Help us keep the lights on


Used By

Total: 0


0.1.1 - May 31, 2019

0.1.0 - May 30, 2019