Server-sent events (SSE) client implementation in Swift for iOS, macOS, tvOS, and watchOS
LDSwiftEventSource is a cross platform implementation of the EventSource specification written in Swift. It was developed for use in the LaunchDarkly iOS SDK. Generated API docs are available on GitHub Pages.
To use the CocoaPods dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your Podfile
:
pod 'LDSwiftEventSource', '~> 3.3'
To use the Carthage dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your Cartfile
:
github "LaunchDarkly/swift-eventsource" ~> 3.3
The Swift Package Manager is a dependency manager integrated into the swift
compiler and Xcode. Note that the LDSwiftEventSource Swift package provides both a LDSwiftEventSource
product, which is explicitly dynamic, and a LDSwiftEventSourceStatic
product which is explicitly static.
To integrate LDSwiftEventSource into an Xcode project, go to the project editor, and select Swift Packages
. From here hit the +
button and follow the prompts using https://github.com/LaunchDarkly/swift-eventsource.git
as the URL.
To include LDSwiftEventSource in a Swift package, simply add it to the dependencies section of your Package.swift
file. And add the desired product as a dependency for your targets.
dependencies: [
.package(url: "https://github.com/LaunchDarkly/swift-eventsource.git", .upToNextMajor(from: "3.3.0"))
]
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.