Skip to content

Commit

Permalink
Update README for 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marinbenc authored Apr 17, 2019
1 parent 59d40f0 commit 5ab6dba
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ This project is still a work in progress, pull requests and issues are very welc
Check out [Get Started](http://cocoapods.org/) tab on [cocoapods.org](http://cocoapods.org/).

To use Scaledrone in your project add the following 'Podfile' to your project

```ruby
pod 'Scaledrone', '~> 0.4.0'
pod 'Scaledrone', '~> 0.5.0'
```

Then run:
Expand Down Expand Up @@ -42,23 +43,23 @@ After you are connected, there are some delegate methods that we need to impleme
#### scaledroneDidConnect

```swift
func scaledroneDidConnect(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidConnect(scaledrone: Scaledrone, error: Error?) {
print("Connected to Scaledrone")
}
```

#### scaledroneDidReceiveError

```swift
func scaledroneDidReceiveError(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidReceiveError(scaledrone: Scaledrone, error: Error?) {
print("Scaledrone error", error ?? "")
}
```

#### scaledroneDidDisconnect

```swift
func scaledroneDidDisconnect(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidDisconnect(scaledrone: Scaledrone, error: Error?) {
print("Scaledrone disconnected", error ?? "")
}
```
Expand All @@ -79,7 +80,7 @@ scaledrone.authenticate(jwt: "jwt_string")
#### scaledroneDidAuthenticate

```swift
func scaledroneDidAuthenticate(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidAuthenticate(scaledrone: Scaledrone, error: Error?) {
print("Scaledrone authenticated", error ?? "")
}
```
Expand All @@ -104,7 +105,7 @@ room.delegate = self
#### scaledroneRoomDidConnect

```swift
func scaledroneRoomDidConnect(room: ScaledroneRoom, error: NSError?) {
func scaledroneRoomDidConnect(room: ScaledroneRoom, error: Error?) {
print("Scaledrone connected to room", room.name, error ?? "")
}
```
Expand Down Expand Up @@ -237,21 +238,21 @@ class ViewController: UIViewController, ScaledroneDelegate, ScaledroneRoomDelega
scaledrone.connect()
}

func scaledroneDidConnect(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidConnect(scaledrone: Scaledrone, error: Error?) {
print("Connected to Scaledrone channel", scaledrone.clientID)
let room = scaledrone.subscribe(roomName: "notifications")
room.delegate = self
}

func scaledroneDidReceiveError(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidReceiveError(scaledrone: Scaledrone, error: Error?) {
print("Scaledrone error")
}

func scaledroneDidDisconnect(scaledrone: Scaledrone, error: NSError?) {
func scaledroneDidDisconnect(scaledrone: Scaledrone, error: Error?) {
print("Scaledrone disconnected")
}

func scaledroneRoomDidConnect(room: ScaledroneRoom, error: NSError?) {
func scaledroneRoomDidConnect(room: ScaledroneRoom, error: Error?) {
print("Scaledrone connected to room", room.name)
}

Expand All @@ -263,6 +264,10 @@ class ViewController: UIViewController, ScaledroneDelegate, ScaledroneRoomDelega

For a longer example see the `ViewController.swift` file.

## Migration notes for Scaledrone 0.5.0:

Scaledrone 0.5.0 removes the use of `NSError` in favor of `Error` in the delegate methods, and adds support for Swift 5.

## Todo:

* Automatic reconnection

0 comments on commit 5ab6dba

Please sign in to comment.