Skip to content

Commit 58362f6

Browse files
committed
clean up readme
1 parent abbd8e6 commit 58362f6

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

README.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@ Manually (iOS 7+)
1212
-----------------
1313
1. Copy the SwiftIO folder into your Xcode project!
1414

15-
CocoaPods (iOS 8+)
15+
CocoaPods 0.36.0 or later (iOS 8+)
1616
------------------
17-
Install cocoapods 0.36.0 or later:
18-
19-
```
20-
$ gem install cocoapods
21-
```
22-
2317
Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
2418

2519
```ruby
@@ -42,7 +36,6 @@ Import in your swift file:
4236
import Socket_IO_Client_Swift
4337
```
4438

45-
4639
API
4740
===
4841
Constructor
@@ -105,6 +98,11 @@ socket.on("ackEvent") {data, ack in
10598
println("Got ackEvent")
10699
}
107100

101+
// data is an array
102+
if let int = data?[1] as? Int {
103+
println("Got int")
104+
}
105+
108106
socket.emitWithAck("ackTest", "test").onAck {data in
109107
println(data?[0])
110108
}
@@ -118,25 +116,6 @@ socket.on("jsonTest") {data, ack in
118116
}
119117
}
120118

121-
// Event items are passed by an array
122-
socket.on("multipleItems") {data, ack in
123-
if data == nil {
124-
return
125-
}
126-
127-
if let str = data![0] as? String {
128-
println(str)
129-
}
130-
131-
if let arr = data![1] as? [Int] {
132-
println(arr)
133-
}
134-
135-
if let obj = data![4] as? NSDictionary {
136-
println(obj["test"])
137-
}
138-
}
139-
140119
// Connecting
141120
socket.connect()
142121
```

0 commit comments

Comments
 (0)