Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andresinaka committed Apr 28, 2018
1 parent cc8e9eb commit 022e4f0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,51 @@ Also in `sse-server` folder you will find an extremely simple `node.js` server t

### Install

You can just drag the `EventSource.swift` file to your project or using CocoaPods:
EventSource delivers itself as a framework. There are a couple ways to include in your app.

#### Cocoapods

1) Include EventSource in your `Podfile`:
`pod 'IKEventSource'`

2) Run `pod install`

```
pod 'IKEventSource'
```

Then import the library:
3) Import the framework:

```
import IKEventSource
```

#### Carthage

1) Include EventSource in your `Cartfile`:
`github "inaka/EventSource"`

2) Run `carthage update --platform 'iOS'`

3) In your app target, navigate to the `Link Binary with Libraries` section, and add `EventSource.framework`, which you should be able to find in your `Carthage/Build/iOS` directory

4) To your test target, add a `Run Script` to call the Carthage `copy-frameworks` script:

`/usr/local/bin/carthage copy-frameworks`

Additionally, add as an input file the Event Source framework. The path probably looks something like this:

`$(SRCROOT)/Carthage/Build/iOS/EventSource.framework`

5) Import the framework:

```
import IKEventSource
```

For further reference see [Carthage's documentation](https://github.com/Carthage/Carthage/blob/master/README.md).

#### Javascript API:

```JavaScript
Expand Down Expand Up @@ -188,6 +220,8 @@ Thanks to all the contributors for pointing out missing stuff or problems and fi
- [heyzooi](https://github.com/heyzooi)
- [alexpalman](https://github.com/alexpalman)
- [robbiet480](https://github.com/robbiet480)
- [tbaranes](https://github.com/tbaranes)
- [jwfriese](https://github.com/jwfriese)

### Contact Us
If you find any **bugs** or have a **problem** while using this library, please [open an issue](https://github.com/inaka/EventSource/issues/new) in this repo (or a pull request :)).
10 changes: 6 additions & 4 deletions Sources/EventSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ open class EventSource: NSObject, URLSessionDataDelegate {
self.task!.resume()
}

internal func newSession(_ configuration: URLSessionConfiguration) -> Foundation.URLSession {
return Foundation.URLSession(configuration: configuration,
delegate: self,
delegateQueue: operationQueue)
internal func newSession(_ configuration: URLSessionConfiguration) -> URLSession {
return URLSession(
configuration: configuration,
delegate: self,
delegateQueue: operationQueue
)
}

//Mark: Close
Expand Down

0 comments on commit 022e4f0

Please sign in to comment.