|
1 | 1 | # LDSwiftEventSource |
2 | | -**Server-Sent Events for iOS, watchOS, tvOS and macOS** |
3 | 2 |
|
4 | | -[](https://circleci.com/gh/launchdarkly/swift-eventsource) |
| 3 | +[](https://circleci.com/gh/launchdarkly/swift-eventsource) |
| 4 | +[](https://cocoapods.org/pods/LDSwiftEventSource) |
| 5 | +[](https://github.com/Carthage/Carthage) |
| 6 | +[](https://swift.org/package-manager/) |
| 7 | +[](https://cocoapods.org/pods/LDSwiftEventSource) |
5 | 8 |
|
6 | | -Swift EventSource implementation originally written to replace a [LaunchDarkly fork](https://github.com/launchdarkly/ios-eventsource) of an [Objective-C implementation](https://github.com/neilco/ios-eventsource) for use in the [LaunchDarkly iOS (Swift) SDK](https://github.com/launchdarkly/ios-client-sdk). |
| 9 | +LDSwiftEventSource is a cross platform implementation of the [EventSource specification](https://www.w3.org/TR/eventsource/) written in Swift. It was developed for use in the [LaunchDarkly iOS SDK](https://github.com/launchdarkly/ios-client-sdk). |
| 10 | + |
| 11 | +## Requirements |
| 12 | +- iOS 10.0+ / watchOS 3.0+ / tvOS 10.0+ / macOS 10.12+ |
| 13 | +- Swift 5.0+ |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +### CocoaPods |
| 18 | + |
| 19 | +To use the [CocoaPods](https://cocoapods.org) dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your `Podfile`: |
| 20 | + |
| 21 | +```ruby |
| 22 | +pod 'LDSwiftEventSource', '~> 1.0' |
| 23 | +``` |
| 24 | + |
| 25 | +### Carthage |
| 26 | + |
| 27 | +To use the [Carthage](https://github.com/Carthage/Carthage) dependency manager to integrate LDSwiftEventSource into your Xcode project, specify it in your `Cartfile` : |
| 28 | + |
| 29 | +```ogdl |
| 30 | +github "LaunchDarkly/swift-eventsource" ~> 1.0 |
| 31 | +``` |
| 32 | + |
| 33 | +### Swift Package Manager |
| 34 | + |
| 35 | +The [Swift Package Manager](https://swift.org/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 explicitely dynamic, and a `LDSwiftEventSourceStatic` product which is explicitely static. |
| 36 | + |
| 37 | +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. |
| 38 | + |
| 39 | +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. |
| 40 | + |
| 41 | +```swift |
| 42 | +dependencies: [ |
| 43 | + .package(url: "https://github.com/LaunchDarkly/swift-eventsource.git", .upToNextMajor(from: "1.0.0")) |
| 44 | +] |
| 45 | +``` |
| 46 | + |
| 47 | +## Contributing |
| 48 | + |
| 49 | +We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK. |
| 50 | + |
| 51 | +## About LaunchDarkly |
| 52 | + |
| 53 | +* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: |
| 54 | + * Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. |
| 55 | + * Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). |
| 56 | + * Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. |
| 57 | + * Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. |
| 58 | +* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/sdk) for a complete list. |
| 59 | +* Explore LaunchDarkly |
| 60 | + * [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information |
| 61 | + * [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides |
| 62 | + * [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation |
| 63 | + * [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates |
| 64 | + * [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies |
0 commit comments