Skip to content

Commit 022e4f0

Browse files
committed
updating readme
1 parent cc8e9eb commit 022e4f0

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,51 @@ Also in `sse-server` folder you will find an extremely simple `node.js` server t
2424

2525
### Install
2626

27-
You can just drag the `EventSource.swift` file to your project or using CocoaPods:
27+
EventSource delivers itself as a framework. There are a couple ways to include in your app.
28+
29+
#### Cocoapods
30+
31+
1) Include EventSource in your `Podfile`:
32+
`pod 'IKEventSource'`
33+
34+
2) Run `pod install`
2835

2936
```
3037
pod 'IKEventSource'
3138
3239
```
3340

34-
Then import the library:
41+
3) Import the framework:
3542

3643
```
3744
import IKEventSource
3845
```
3946

47+
#### Carthage
48+
49+
1) Include EventSource in your `Cartfile`:
50+
`github "inaka/EventSource"`
51+
52+
2) Run `carthage update --platform 'iOS'`
53+
54+
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
55+
56+
4) To your test target, add a `Run Script` to call the Carthage `copy-frameworks` script:
57+
58+
`/usr/local/bin/carthage copy-frameworks`
59+
60+
Additionally, add as an input file the Event Source framework. The path probably looks something like this:
61+
62+
`$(SRCROOT)/Carthage/Build/iOS/EventSource.framework`
63+
64+
5) Import the framework:
65+
66+
```
67+
import IKEventSource
68+
```
69+
70+
For further reference see [Carthage's documentation](https://github.com/Carthage/Carthage/blob/master/README.md).
71+
4072
#### Javascript API:
4173

4274
```JavaScript
@@ -188,6 +220,8 @@ Thanks to all the contributors for pointing out missing stuff or problems and fi
188220
- [heyzooi](https://github.com/heyzooi)
189221
- [alexpalman](https://github.com/alexpalman)
190222
- [robbiet480](https://github.com/robbiet480)
223+
- [tbaranes](https://github.com/tbaranes)
224+
- [jwfriese](https://github.com/jwfriese)
191225

192226
### Contact Us
193227
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 :)).

Sources/EventSource.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ open class EventSource: NSObject, URLSessionDataDelegate {
8686
self.task!.resume()
8787
}
8888

89-
internal func newSession(_ configuration: URLSessionConfiguration) -> Foundation.URLSession {
90-
return Foundation.URLSession(configuration: configuration,
91-
delegate: self,
92-
delegateQueue: operationQueue)
89+
internal func newSession(_ configuration: URLSessionConfiguration) -> URLSession {
90+
return URLSession(
91+
configuration: configuration,
92+
delegate: self,
93+
delegateQueue: operationQueue
94+
)
9395
}
9496

9597
//Mark: Close

0 commit comments

Comments
 (0)