Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
added help notes and update to Swift3 url and latest library version
  • Loading branch information
danipralea committed Nov 12, 2016
1 parent 97abffc commit 348635c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -34,7 +34,7 @@ github "danielrhodes/Swift-ActionCableClient"
```swift
import ActionCableClient

self.client = ActionCableClient(URL: NSURL(string: "ws://domain.tld/cable")!)
self.client = ActionCableClient(url: URL(string: "ws://domain.tld/cable")!)

// Connect!
client.connect()
Expand All @@ -54,6 +54,10 @@ client.onDisconnected = {(error: Error?) in
// Create the Room Channel
let roomChannel = client.create("RoomChannel") //The channel name must match the class name on the server

// More advanced usage
let room_identifier = ["room_id" : identifier]
let roomChannel = client.create("RoomChannel", identifier: room_identifier, autoSubscribe: true, bufferActions: true)

```

### Channel Callbacks
Expand Down Expand Up @@ -90,6 +94,8 @@ roomChannel["speak"](["message": "Hello, World!"])

// Alternate less magical way:
roomChannel.action("speak", ["message": "Hello, World!"])

// Note: The `speak` action must be defined already on the server
```

### Authorization & Headers
Expand Down

0 comments on commit 348635c

Please sign in to comment.