Skip to content

Commit 16dac5b

Browse files
committed
Link to ViewController in Example at top of README for sample code
1 parent d5ddada commit 16dac5b

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,7 @@
1010

1111
## I just want to copy and paste some code to get me started
1212

13-
```swift
14-
// Only use your secret here for testing or if you're sure that there's no security risk
15-
let pusher = Pusher(key: "YOUR_APP_KEY", options: ["secret": "YOUR_APP_SECRET"])
16-
17-
// It doesn't matter (within reason) where this goes but you have to call it at some point
18-
pusher.connect()
19-
20-
let onMemberAdded = { (member: PresenceChannelMember) in
21-
print(member)
22-
}
23-
let chan = pusher.subscribe("presence-channel", onMemberAdded: onMemberAdded)
24-
25-
chan.bind("test-event", callback: { (data: AnyObject?) -> Void in
26-
print(data)
27-
if let data = data as? [String : AnyObject] {
28-
if let testVal = data["test"] as? String {
29-
print(testVal)
30-
}
31-
}
32-
})
33-
34-
chan.trigger("client-test", data: ["test": "some value"])
35-
```
13+
What else would you want? Head over to the example app [ViewController.swift](https://github.com/pusher/pusher-websocket-swift/blob/master/Example/ViewController.swift) to get some code you can drop in to get started.
3614

3715
## Table of Contents
3816

0 commit comments

Comments
 (0)