Skip to content

Commit

Permalink
trim example
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearace committed Mar 11, 2015
1 parent 8c02f5e commit 114ce4c
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,6 @@ socket.on("ackEvent") {data, ack in
ack?("Got your event", "dude")
}

socket.on("disconnect") {data, ack in
if let reason = data?[0] as? String {
println("Socket disconnected: \(reason)")
}
}

socket.on("reconnect") {data, ack in
if let reason = data?[0] as? String {
println("Socket reconnecting: \(reason)")
}
}

socket.on("reconnectAttempt") {data, ack in
if let triesLeft = data?[0] as? Int {
println(triesLeft)
}
}
// End Socket Events

socket.on("jsonTest") {data, ack in
if let json = data?[0] as? NSDictionary {
println(json["test"]!) // foo bar
Expand All @@ -122,22 +103,6 @@ socket.on("multipleItems") {data, ack in
}
}

// Recieving binary
socket.on("dataTest") {data, ack in
if let data = data?[0] as? NSData {
println("data is binary")
}
}

socket.on("objectDataTest") {data, ack in
if let dict = data?[0] as? NSDictionary {
if let data = dict["data"] as? NSData {
let string = NSString(data: data, encoding: NSUTF8StringEncoding)
println("Got data: \(string!)")
}
}
}

// Connecting
socket.connect()

Expand Down

0 comments on commit 114ce4c

Please sign in to comment.