Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. SwiftEventBus

SwiftEventBus

MITSwift5.1.0

A lightweight publish/subscribe event bus for iOS, enabling decoupled communication between Swift components.

GitHubGitHub
1.1k stars108 forks0 contributors

What is SwiftEventBus?

SwiftEventBus is a Swift library that provides a publish/subscribe event bus for iOS applications. It enables components to communicate by posting and listening for events, eliminating tight coupling and simplifying code architecture. The library handles thread safety and offers specific methods for main and background thread operations.

Target Audience

iOS developers building Swift applications who need a clean, decoupled way for components (like ViewControllers, services, or models) to communicate without direct references.

Value Proposition

Developers choose SwiftEventBus for its simplicity, lightweight footprint, and thread-safe implementation, which avoids the boilerplate and complexity of manual notification management or delegation patterns.

Overview

A publish/subscribe EventBus optimized for iOS

Use Cases

Best For

  • Decoupling ViewControllers from business logic or services
  • Handling communication between unrelated components in an iOS app
  • Simplifying state updates across multiple screens
  • Managing background task completion notifications
  • Implementing clean architecture patterns like MVVM or VIPER
  • Reducing tight coupling in large Swift codebases

Not Ideal For

  • iOS projects already using Combine or SwiftUI's native event handling, as SwiftEventBus adds unnecessary abstraction.
  • Applications requiring strict type-safe event communication, since SwiftEventBus uses string identifiers prone to runtime errors.
  • Large-scale apps with complex event management needs, such as event tracing or prioritization, which SwiftEventBus does not support.

Pros & Cons

Pros

Lightweight Design

Described as 'tiny' and 'fast' in the README, it minimizes performance overhead compared to heavier alternatives, making it ideal for resource-conscious apps.

Thread Safety

Provides thread-safe event posting and handling with dedicated methods like onMainThread and onBackgroundThread, avoiding common concurrency issues in iOS development.

Easy Observer Management

Includes simple unregister methods to clean up observers, preventing memory leaks and simplifying lifecycle management, as demonstrated in the usage examples.

Decoupled Communication

Enables components to send and receive events without direct dependencies, reducing tight coupling and improving code maintainability, as highlighted in the philosophy.

Cons

String-Based Events

Relies on string identifiers for events, which can lead to typos and runtime errors instead of compile-time type safety, a limitation compared to modern Swift frameworks.

Limited Advanced Features

Lacks features like event filtering, queue management, or persistence, making it unsuitable for complex event-driven architectures that require more control.

Version Fragmentation

The README shows support for multiple Swift versions (e.g., Swift 2.2 to 5.0), which might indicate maintenance challenges and compatibility issues over time.

Frequently Asked Questions

Quick Stats

Stars1,123
Forks108
Contributors0
Open Issues12
Last commit5 years ago
CreatedSince 2015

Tags

#ios#thread-safety#publish-subscribe#event-bus#notifications#communication#decoupling#mobile-development#thread#pub-sub#swift#eventbus

Built With

S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 15 hours ago

Related Projects

RxSwiftRxSwift

Reactive Programming in Swift

Stars24,650
Forks4,165
Last commit25 days ago
ReactiveCocoaReactiveCocoa

Cocoa framework and Obj-C dynamism bindings for ReactiveSwift.

Stars19,848
Forks3,421
Last commit7 months ago
PromiseKitPromiseKit

Promises for Swift & ObjC.

Stars14,246
Forks1,458
Last commit2 months ago
ReSwiftReSwift

Unidirectional Data Flow in Swift - Inspired by Redux

Stars7,590
Forks520
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub